Handle more complex RTF font tables.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38107 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2014-10-05 20:49:40 +00:00
parent ab61aefcfa
commit c88e9fdf8a
5 changed files with 522 additions and 484 deletions

View file

@ -1,4 +1,11 @@
2014-10-04 Fred Kiefer <FredKiefer@gmx.de>
2014-10-05 Fred Kiefer <FredKiefer@gmx.de>
* TextConverters/RTF/rtfScanner.m: Add RTFfamilyBiDi.
* TextConverters/RTF/rtfGrammar.y: Handle more complex font tables.
* TextConverters/RTF/rtfGrammar.tab.h,
* TextConverters/RTF/rtfGrammar.tab.m: Regenerated.
2014-10-05 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSImage.m (-lockFocusOnRepresentation:): Allow image
caching during printing.

View file

@ -149,7 +149,8 @@ extern int GSRTFdebug;
RTFfamilyModern = 358,
RTFfamilyScript = 359,
RTFfamilyDecor = 360,
RTFfamilyTech = 361
RTFfamilyTech = 361,
RTFfamilyBiDi = 362
};
#endif
@ -166,7 +167,7 @@ typedef union YYSTYPE
/* Line 2058 of yacc.c */
#line 170 "rtfGrammar.tab.h"
#line 171 "rtfGrammar.tab.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */

File diff suppressed because it is too large Load diff

View file

@ -197,6 +197,7 @@ int fieldStart = 0;
%token RTFfamilyScript
%token RTFfamilyDecor
%token RTFfamilyTech
%token RTFfamilyBiDi
%type <number> rtfFontFamily rtfCharset rtfFontStatement
%type <text> rtfFieldinst
@ -205,18 +206,18 @@ int fieldStart = 0;
%%
rtfFile: '{' { GSRTFstart(CTXT); } RTFstart rtfCharset rtfIngredients { GSRTFstop(CTXT); } '}'
rtfFile: '{' { GSRTFstart(CTXT); } RTFstart rtfIngredients { GSRTFstop(CTXT); } '}'
;
/* FIXME: This should change the used encoding */
rtfCharset: RTFansi { $$ = 1; }
| RTFmac { $$ = 2; }
| RTFpc { $$ = 3; }
| RTFpca { $$ = 4; }
/* If it's an unknown character set, assume ansi. */
| RTFOtherStatement { $$ = 1; free((void*)$1.name); }
;
rtfIngredients: /* empty */
| rtfIngredients rtfCharset
| rtfIngredients rtfFontList
| rtfIngredients rtfColorDef
| rtfIngredients rtfStatement
@ -589,6 +590,12 @@ rtfFonts:
/* RTFtext introduces the fontName */
rtfFontStatement: RTFfont rtfFontFamily rtfFontAttrs RTFtext { GSRTFregisterFont(CTXT, $4, $2, $1.parameter);
free((void *)$4); }
/* fbidi should be a font family, but it seems to be used differently */
| RTFfont RTFfamilyBiDi rtfFontFamily rtfFontAttrs RTFtext { GSRTFregisterFont(CTXT, $5, $3, $1.parameter);
free((void *)$5); }
/* Theme fonts */
| RTFOtherStatement RTFfont RTFfamilyBiDi rtfFontFamily rtfFontAttrs RTFtext { GSRTFregisterFont(CTXT, $6, $4, $2.parameter);
free((void *)$6); }
;
rtfFontAttrs: /* empty */

View file

@ -177,6 +177,7 @@ LexKeyword RTFcommands[] =
{"endash", token(RTFendash)},
{"enspace", token(RTFenspace)},
{"f", token(RTFfont)},
{"fbidi", token(RTFfamilyBiDi)},
{"fcharset", token(RTFfcharset)},
{"fdecor", token(RTFfamilyDecor)},
{"fi", token(RTFfirstLineIndent)},