mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
Do not show carriage return characters (bug #3696)
This commit is contained in:
parent
2136003e1c
commit
4f190bf7f4
1 changed files with 12 additions and 3 deletions
|
@ -16,6 +16,7 @@ class BookPageImpl;
|
||||||
|
|
||||||
static bool ucsSpace (int codePoint);
|
static bool ucsSpace (int codePoint);
|
||||||
static bool ucsLineBreak (int codePoint);
|
static bool ucsLineBreak (int codePoint);
|
||||||
|
static bool ucsCarriageReturn (int codePoint);
|
||||||
static bool ucsBreakingSpace (int codePoint);
|
static bool ucsBreakingSpace (int codePoint);
|
||||||
|
|
||||||
struct BookTypesetter::Style { virtual ~Style () {} };
|
struct BookTypesetter::Style { virtual ~Style () {} };
|
||||||
|
@ -280,7 +281,7 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
|
||||||
style.mActiveColour = fontColour;
|
style.mActiveColour = fontColour;
|
||||||
style.mNormalColour = fontColour;
|
style.mNormalColour = fontColour;
|
||||||
style.mInteractiveId = 0;
|
style.mInteractiveId = 0;
|
||||||
|
|
||||||
return &style;
|
return &style;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,7 +343,7 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
|
||||||
|
|
||||||
writeImpl (static_cast <StyleImpl*> (style), begin_, end_);
|
writeImpl (static_cast <StyleImpl*> (style), begin_, end_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lineBreak (float margin)
|
void lineBreak (float margin)
|
||||||
{
|
{
|
||||||
assert (margin == 0); //TODO: figure out proper behavior here...
|
assert (margin == 0); //TODO: figure out proper behavior here...
|
||||||
|
@ -352,7 +353,7 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
|
||||||
mRun = NULL;
|
mRun = NULL;
|
||||||
mLine = NULL;
|
mLine = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sectionBreak (int margin)
|
void sectionBreak (int margin)
|
||||||
{
|
{
|
||||||
add_partial_text();
|
add_partial_text();
|
||||||
|
@ -1188,6 +1189,9 @@ public:
|
||||||
{
|
{
|
||||||
Utf8Stream::UnicodeChar code_point = stream.consume ();
|
Utf8Stream::UnicodeChar code_point = stream.consume ();
|
||||||
|
|
||||||
|
if (ucsCarriageReturn (code_point))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (!ucsSpace (code_point))
|
if (!ucsSpace (code_point))
|
||||||
glyphStream.emitGlyph (code_point);
|
glyphStream.emitGlyph (code_point);
|
||||||
else
|
else
|
||||||
|
@ -1331,6 +1335,11 @@ static bool ucsLineBreak (int codePoint)
|
||||||
return codePoint == '\n';
|
return codePoint == '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool ucsCarriageReturn (int codePoint)
|
||||||
|
{
|
||||||
|
return codePoint == '\r';
|
||||||
|
}
|
||||||
|
|
||||||
static bool ucsSpace (int codePoint)
|
static bool ucsSpace (int codePoint)
|
||||||
{
|
{
|
||||||
switch (codePoint)
|
switch (codePoint)
|
||||||
|
|
Loading…
Reference in a new issue