mirror of
https://github.com/mcneel/opennurbs.git
synced 2026-03-06 15:05:52 +08:00
Sync changes from upstream repository
Co-authored-by: alain <alain@mcneel.com> Co-authored-by: chuck <chuck@mcneel.com> Co-authored-by: Dale Fugier <dale@mcneel.com> Co-authored-by: Greg Arden <greg@mcneel.com> Co-authored-by: Mikko Oksanen <mikko@mcneel.com> Co-authored-by: Pierre Cuvilliers <pierre@mcneel.com> Co-authored-by: Steve Baer <steve@mcneel.com> Co-authored-by: wfcook <github@wfcook.com>
This commit is contained in:
@@ -281,10 +281,17 @@ bool ON_TextContent::GetRichTextFontTable(
|
||||
int font_pos = rich_text.Find(L"\\f", i);
|
||||
if (font_pos > i)
|
||||
{
|
||||
bool pos_passed_fnumber = false;
|
||||
int fnumber_len = 2; // the \f
|
||||
for (int j = font_pos + 2; j < table_len; j++)
|
||||
{
|
||||
if (rtf[j] == L' ')
|
||||
if (rtf[j] != L' ' && !pos_passed_fnumber)
|
||||
{
|
||||
fnumber_len++;
|
||||
}
|
||||
else
|
||||
{
|
||||
pos_passed_fnumber = true;
|
||||
for (int si = 0; si + j < table_len; si++)
|
||||
{
|
||||
if (rich_text[si + j] != L' ')
|
||||
@@ -297,7 +304,11 @@ bool ON_TextContent::GetRichTextFontTable(
|
||||
{
|
||||
if (rtf[ni + j] == L';' || rtf[ni + j] == L'}')
|
||||
{
|
||||
font_table.AppendNew() = rich_text.SubString(j, ni);
|
||||
ON_wString fn = ON_wString(rich_text.SubString(font_pos, fnumber_len));
|
||||
// only add the font if it's actually used in the rtf string
|
||||
if (rich_text.Find(fn, table_len) != -1) {
|
||||
font_table.AppendNew() = rich_text.SubString(j, ni);
|
||||
}
|
||||
i = ni + j;
|
||||
j = len;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user