summaryrefslogtreecommitdiff
path: root/core/fxge/fx_font.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-09-28 15:59:42 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-28 20:40:36 +0000
commit10e1f05a9e644cd954792bcd40ef787551cbd209 (patch)
treed203254a0a2c856a9b8ba5a0445a883c7072dd77 /core/fxge/fx_font.h
parentdd0e6e1eba14c76dedd4b4e55ab47406856c9a76 (diff)
downloadpdfium-10e1f05a9e644cd954792bcd40ef787551cbd209.tar.xz
Cleanup font defines
Use methods to match font information; cleanup some font code. Change-Id: Ib99c1e466e56723cb5d264d49e1caf9bbbc0daed Reviewed-on: https://pdfium-review.googlesource.com/15072 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxge/fx_font.h')
-rw-r--r--core/fxge/fx_font.h37
1 files changed, 36 insertions, 1 deletions
diff --git a/core/fxge/fx_font.h b/core/fxge/fx_font.h
index 8f559829b6..f2550d0488 100644
--- a/core/fxge/fx_font.h
+++ b/core/fxge/fx_font.h
@@ -32,6 +32,7 @@ using CFX_TypeFace = SkTypeface;
/* Typical weight values */
#define FXFONT_FW_NORMAL 400
#define FXFONT_FW_BOLD 700
+#define FXFONT_FW_BOLD_BOLD 900
/* Font styles as defined in PDF 1.7 Table 5.20 */
#define FXFONT_NORMAL (0)
@@ -44,7 +45,6 @@ using CFX_TypeFace = SkTypeface;
#define FXFONT_ALLCAP (1 << 16)
#define FXFONT_SMALLCAP (1 << 17)
#define FXFONT_BOLD (1 << 18)
-#define FXFONT_BOLD_ITALIC (FXFONT_BOLD | FXFONT_ITALIC)
/* Other font flags */
#define FXFONT_USEEXTERNATTR 0x80000
@@ -105,4 +105,39 @@ ByteString GetNameFromTT(const uint8_t* name_table,
int PDF_GetStandardFontName(ByteString* name);
+inline bool FontStyleIsBold(uint32_t style) {
+ return !!(style & FXFONT_BOLD);
+}
+inline bool FontStyleIsItalic(uint32_t style) {
+ return !!(style & FXFONT_ITALIC);
+}
+inline bool FontStyleIsFixedPitch(uint32_t style) {
+ return !!(style & FXFONT_FIXED_PITCH);
+}
+inline bool FontStyleIsSymbolic(uint32_t style) {
+ return !!(style & FXFONT_SYMBOLIC);
+}
+inline bool FontStyleIsNonSymbolic(uint32_t style) {
+ return !!(style & FXFONT_NONSYMBOLIC);
+}
+inline bool FontStyleIsAllCaps(uint32_t style) {
+ return !!(style & FXFONT_ALLCAP);
+}
+inline bool FontStyleIsSerif(uint32_t style) {
+ return !!(style & FXFONT_SERIF);
+}
+inline bool FontStyleIsScript(uint32_t style) {
+ return !!(style & FXFONT_SCRIPT);
+}
+
+inline bool FontFamilyIsFixedPitch(uint32_t family) {
+ return !!(family & FXFONT_FF_FIXEDPITCH);
+}
+inline bool FontFamilyIsRoman(uint32_t family) {
+ return !!(family & FXFONT_FF_ROMAN);
+}
+inline bool FontFamilyIsScript(int32_t family) {
+ return !!(family & FXFONT_FF_SCRIPT);
+}
+
#endif // CORE_FXGE_FX_FONT_H_