From 412fa65331cc04776bf1e3da5f51f29ea0fc7937 Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Fri, 24 Feb 2017 16:16:02 -0500 Subject: Remove repeated flags from CPDF_Font MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moved all the flags to CFX_Font. Explicitly stated which ones are valued according to the PDF spec to avoid their values being changed. Change-Id: Ib57593234a4b9b83ef1ad593d0396c64159f303f Reviewed-on: https://pdfium-review.googlesource.com/2837 Commit-Queue: Nicolás Peña Reviewed-by: Tom Sepez --- core/fxge/fx_font.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'core/fxge') diff --git a/core/fxge/fx_font.h b/core/fxge/fx_font.h index 3c095d1976..07392fa07f 100644 --- a/core/fxge/fx_font.h +++ b/core/fxge/fx_font.h @@ -58,13 +58,18 @@ using CFX_TypeFace = SkTypeface; #define FXFONT_FW_NORMAL 400 #define FXFONT_FW_BOLD 700 -/* Font styles */ -#define FXFONT_FIXED_PITCH 0x01 -#define FXFONT_SERIF 0x02 -#define FXFONT_SYMBOLIC 0x04 -#define FXFONT_SCRIPT 0x08 -#define FXFONT_ITALIC 0x40 -#define FXFONT_BOLD 0x40000 +/* Font styles as defined in PDF 1.7 Table 5.20 */ +#define FXFONT_FIXED_PITCH (1 << 0) +#define FXFONT_SERIF (1 << 1) +#define FXFONT_SYMBOLIC (1 << 2) +#define FXFONT_SCRIPT (1 << 3) +#define FXFONT_NONSYMBOLIC (1 << 5) +#define FXFONT_ITALIC (1 << 6) +#define FXFONT_ALLCAP (1 << 16) +#define FXFONT_SMALLCAP (1 << 17) +#define FXFONT_BOLD (1 << 18) + +/* Other font flags */ #define FXFONT_USEEXTERNATTR 0x80000 #define FXFONT_CIDFONT 0x100000 #ifdef PDF_ENABLE_XFA -- cgit v1.2.3