summaryrefslogtreecommitdiff
path: root/core/fxge
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxge')
-rw-r--r--core/fxge/ge/cfx_font.cpp27
-rw-r--r--core/fxge/include/fx_font.h6
2 files changed, 15 insertions, 18 deletions
diff --git a/core/fxge/ge/cfx_font.cpp b/core/fxge/ge/cfx_font.cpp
index 3d2e6d6499..feea8b0aa1 100644
--- a/core/fxge/ge/cfx_font.cpp
+++ b/core/fxge/ge/cfx_font.cpp
@@ -446,30 +446,27 @@ FX_BOOL CFX_Font::GetGlyphBBox(uint32_t glyph_index, FX_RECT& bbox) {
return TRUE;
}
-FX_BOOL CFX_Font::IsItalic() const {
+bool CFX_Font::IsItalic() const {
if (!m_Face)
- return FALSE;
+ return false;
- FX_BOOL ret = FXFT_Is_Face_Italic(m_Face) == FXFT_STYLE_FLAG_ITALIC;
- if (!ret) {
- CFX_ByteString str(FXFT_Get_Face_Style_Name(m_Face));
- str.MakeLower();
- if (str.Find("italic") != -1)
- ret = TRUE;
- }
- return ret;
+ if (FXFT_Is_Face_Italic(m_Face) == FXFT_STYLE_FLAG_ITALIC)
+ return true;
+ CFX_ByteString str(FXFT_Get_Face_Style_Name(m_Face));
+ str.MakeLower();
+ return str.Find("italic") != -1;
}
-FX_BOOL CFX_Font::IsBold() const {
+bool CFX_Font::IsBold() const {
if (!m_Face)
- return FALSE;
+ return false;
return FXFT_Is_Face_Bold(m_Face) == FXFT_STYLE_FLAG_BOLD;
}
-FX_BOOL CFX_Font::IsFixedWidth() const {
+bool CFX_Font::IsFixedWidth() const {
if (!m_Face)
- return FALSE;
- return FXFT_Is_Face_fixedwidth(m_Face);
+ return false;
+ return FXFT_Is_Face_fixedwidth(m_Face) != 0;
}
CFX_ByteString CFX_Font::GetPsName() const {
diff --git a/core/fxge/include/fx_font.h b/core/fxge/include/fx_font.h
index a607f3e0d5..9a976c44b7 100644
--- a/core/fxge/include/fx_font.h
+++ b/core/fxge/include/fx_font.h
@@ -117,9 +117,9 @@ class CFX_Font {
int GetAscent() const;
int GetDescent() const;
FX_BOOL GetGlyphBBox(uint32_t glyph_index, FX_RECT& bbox);
- FX_BOOL IsItalic() const;
- FX_BOOL IsBold() const;
- FX_BOOL IsFixedWidth() const;
+ bool IsItalic() const;
+ bool IsBold() const;
+ bool IsFixedWidth() const;
FX_BOOL IsVertical() const { return m_bVertical; }
CFX_ByteString GetPsName() const;
CFX_ByteString GetFamilyName() const;