summaryrefslogtreecommitdiff
path: root/core/src/fxge/ge
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-07-27 11:55:29 -0700
committerTom Sepez <tsepez@chromium.org>2015-07-27 11:55:29 -0700
commitff46aaf499edcf153ee2f57c7016587aa96dcfa0 (patch)
tree0a0d92713af476897899b126d180cc6294433d10 /core/src/fxge/ge
parentaafeff816e22c1333c17d8a0eb4fe8927c28142d (diff)
downloadpdfium-ff46aaf499edcf153ee2f57c7016587aa96dcfa0.tar.xz
FX Bool considered harmful, part 3
Try to reland this patch after fixing underlying issues that caused it to be reverted. fx_system.h is the only manual edit. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1258093002 .
Diffstat (limited to 'core/src/fxge/ge')
-rw-r--r--core/src/fxge/ge/fx_ge_device.cpp94
-rw-r--r--core/src/fxge/ge/fx_ge_font.cpp72
-rw-r--r--core/src/fxge/ge/fx_ge_fontmap.cpp120
-rw-r--r--core/src/fxge/ge/fx_ge_linux.cpp20
-rw-r--r--core/src/fxge/ge/fx_ge_path.cpp68
-rw-r--r--core/src/fxge/ge/fx_ge_ps.cpp64
-rw-r--r--core/src/fxge/ge/fx_ge_text.cpp94
-rw-r--r--core/src/fxge/ge/text_int.h12
8 files changed, 272 insertions, 272 deletions
diff --git a/core/src/fxge/ge/fx_ge_device.cpp b/core/src/fxge/ge/fx_ge_device.cpp
index 0baa99cdc7..ecdd1b0183 100644
--- a/core/src/fxge/ge/fx_ge_device.cpp
+++ b/core/src/fxge/ge/fx_ge_device.cpp
@@ -35,7 +35,7 @@ void CFX_RenderDevice::InitDeviceInfo()
m_ClipBox.bottom = m_Height;
}
}
-FX_BOOL CFX_RenderDevice::StartRendering()
+bool CFX_RenderDevice::StartRendering()
{
return m_pDeviceDriver->StartRendering();
}
@@ -47,7 +47,7 @@ void CFX_RenderDevice::SaveState()
{
m_pDeviceDriver->SaveState();
}
-void CFX_RenderDevice::RestoreState(FX_BOOL bKeepSaved)
+void CFX_RenderDevice::RestoreState(bool bKeepSaved)
{
m_pDeviceDriver->RestoreState(bKeepSaved);
UpdateClipBox();
@@ -60,7 +60,7 @@ CFX_Matrix CFX_RenderDevice::GetCTM() const
{
return m_pDeviceDriver->GetCTM();
}
-FX_BOOL CFX_RenderDevice::CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int height) const
+bool CFX_RenderDevice::CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int height) const
{
if (m_RenderCaps & FXRC_CMYK_OUTPUT) {
return pDIB->Create(width, height, m_RenderCaps & FXRC_ALPHA_OUTPUT ? FXDIB_Cmyka : FXDIB_Cmyk);
@@ -74,37 +74,37 @@ FX_BOOL CFX_RenderDevice::CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width,
return pDIB->Create(width, height, m_RenderCaps & FXRC_ALPHA_OUTPUT ? FXDIB_Argb : FXDIB_Rgb);
#endif
}
-FX_BOOL CFX_RenderDevice::SetClip_PathFill(const CFX_PathData* pPathData,
+bool CFX_RenderDevice::SetClip_PathFill(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
int fill_mode
)
{
if (!m_pDeviceDriver->SetClip_PathFill(pPathData, pObject2Device, fill_mode)) {
- return FALSE;
+ return false;
}
UpdateClipBox();
- return TRUE;
+ return true;
}
-FX_BOOL CFX_RenderDevice::SetClip_PathStroke(const CFX_PathData* pPathData,
+bool CFX_RenderDevice::SetClip_PathStroke(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState
)
{
if (!m_pDeviceDriver->SetClip_PathStroke(pPathData, pObject2Device, pGraphState)) {
- return FALSE;
+ return false;
}
UpdateClipBox();
- return TRUE;
+ return true;
}
-FX_BOOL CFX_RenderDevice::SetClip_Rect(const FX_RECT* pRect)
+bool CFX_RenderDevice::SetClip_Rect(const FX_RECT* pRect)
{
CFX_PathData path;
path.AppendRect((FX_FLOAT)(pRect->left), (FX_FLOAT)(pRect->bottom), (FX_FLOAT)(pRect->right), (FX_FLOAT)(pRect->top));
if (!SetClip_PathFill(&path, NULL, FXFILL_WINDING)) {
- return FALSE;
+ return false;
}
UpdateClipBox();
- return TRUE;
+ return true;
}
void CFX_RenderDevice::UpdateClipBox()
{
@@ -116,7 +116,7 @@ void CFX_RenderDevice::UpdateClipBox()
m_ClipBox.right = m_Width;
m_ClipBox.bottom = m_Height;
}
-FX_BOOL CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
+bool CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
FX_DWORD fill_color, FX_DWORD stroke_color, int fill_mode,
@@ -149,7 +149,7 @@ FX_BOOL CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
y2 = pPoints[1].m_PointY;
}
DrawCosmeticLine(x1, y1, x2, y2, fill_color, fill_mode, alpha_flag, pIccTransform, blend_type);
- return TRUE;
+ return true;
}
if ((pPathData->GetPointCount() == 5 || pPathData->GetPointCount() == 4) && stroke_alpha == 0) {
CFX_FloatRect rect_f;
@@ -184,13 +184,13 @@ FX_BOOL CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
}
}
if (FillRect(&rect_i, fill_color, alpha_flag, pIccTransform, blend_type)) {
- return TRUE;
+ return true;
}
}
}
if((fill_mode & 3) && stroke_alpha == 0 && !(fill_mode & FX_FILL_STROKE) && !(fill_mode & FX_FILL_TEXT_MODE)) {
CFX_PathData newPath;
- FX_BOOL bThin = FALSE;
+ bool bThin = false;
if (pPathData->GetZeroAreaPath(newPath, (CFX_Matrix*)pObject2Device, bThin, m_pDeviceDriver->GetDriverType())) {
CFX_GraphStateData graphState;
graphState.m_LineWidth = 0.0f;
@@ -215,7 +215,7 @@ FX_BOOL CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
}
if ((fill_mode & 3) && fill_alpha && stroke_alpha < 0xff && (fill_mode & FX_FILL_STROKE)) {
if (!(m_RenderCaps & FXRC_GET_BITS)) {
- return FALSE;
+ return false;
}
CFX_FloatRect bbox;
if (pGraphState) {
@@ -232,19 +232,19 @@ FX_BOOL CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
FX_RECT rect = bbox.GetOutterRect();
CFX_DIBitmap bitmap, Backdrop;
if (!CreateCompatibleBitmap(&bitmap, FXSYS_round(rect.Width() * fScaleX), FXSYS_round(rect.Height() * fScaleY))) {
- return FALSE;
+ return false;
}
if (bitmap.HasAlpha()) {
bitmap.Clear(0);
Backdrop.Copy(&bitmap);
} else {
if (!m_pDeviceDriver->GetDIBits(&bitmap, rect.left, rect.top, NULL)) {
- return FALSE;
+ return false;
}
Backdrop.Copy(&bitmap);
}
CFX_FxgeDevice bitmap_device;
- bitmap_device.Attach(&bitmap, 0, FALSE, &Backdrop, TRUE);
+ bitmap_device.Attach(&bitmap, 0, false, &Backdrop, true);
CFX_AffineMatrix matrix;
if (pObject2Device) {
matrix = *pObject2Device;
@@ -252,51 +252,51 @@ FX_BOOL CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
matrix.TranslateI(-rect.left, -rect.top);
matrix.Concat(fScaleX, 0, 0, fScaleY, 0, 0);
if (!bitmap_device.GetDeviceDriver()->DrawPath(pPathData, &matrix, pGraphState, fill_color, stroke_color, fill_mode, alpha_flag, pIccTransform, blend_type)) {
- return FALSE;
+ return false;
}
FX_RECT src_rect(0, 0, FXSYS_round(rect.Width() * fScaleX), FXSYS_round(rect.Height() * fScaleY));
return m_pDeviceDriver->SetDIBits(&bitmap, 0, &src_rect, rect.left, rect.top, FXDIB_BLEND_NORMAL);
}
return m_pDeviceDriver->DrawPath(pPathData, pObject2Device, pGraphState, fill_color, stroke_color, fill_mode, alpha_flag, pIccTransform, blend_type);
}
-FX_BOOL CFX_RenderDevice::SetPixel(int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform)
+bool CFX_RenderDevice::SetPixel(int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform)
{
if (m_pDeviceDriver->SetPixel(x, y, color, alpha_flag, pIccTransform)) {
- return TRUE;
+ return true;
}
FX_RECT rect(x, y, x + 1, y + 1);
return FillRect(&rect, color, alpha_flag, pIccTransform);
}
-FX_BOOL CFX_RenderDevice::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type)
+bool CFX_RenderDevice::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type)
{
if (m_pDeviceDriver->FillRect(pRect, fill_color, alpha_flag, pIccTransform, blend_type)) {
- return TRUE;
+ return true;
}
if (!(m_RenderCaps & FXRC_GET_BITS)) {
- return FALSE;
+ return false;
}
CFX_DIBitmap bitmap;
if (!CreateCompatibleBitmap(&bitmap, pRect->Width(), pRect->Height())) {
- return FALSE;
+ return false;
}
if (!m_pDeviceDriver->GetDIBits(&bitmap, pRect->left, pRect->top)) {
- return FALSE;
+ return false;
}
if (!bitmap.CompositeRect(0, 0, pRect->Width(), pRect->Height(), fill_color, alpha_flag, pIccTransform)) {
- return FALSE;
+ return false;
}
FX_RECT src_rect(0, 0, pRect->Width(), pRect->Height());
m_pDeviceDriver->SetDIBits(&bitmap, 0, &src_rect, pRect->left, pRect->top, FXDIB_BLEND_NORMAL);
- return TRUE;
+ return true;
}
-FX_BOOL CFX_RenderDevice::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
+bool CFX_RenderDevice::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
int fill_mode, int alpha_flag, void* pIccTransform, int blend_type)
{
if (((m_RenderCaps & FXRC_ALPHA_PATH) &&
(FXGETFLAG_COLORTYPE(alpha_flag) && FXGETFLAG_ALPHA_FILL(alpha_flag) == 0xff)) ||
color >= 0xff000000)
if (m_pDeviceDriver->DrawCosmeticLine(x1, y1, x2, y2, color, alpha_flag, pIccTransform, blend_type)) {
- return TRUE;
+ return true;
}
CFX_GraphStateData graph_state;
CFX_PathData path;
@@ -305,10 +305,10 @@ FX_BOOL CFX_RenderDevice::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2
path.SetPoint(1, x2, y2, FXPT_LINETO);
return m_pDeviceDriver->DrawPath(&path, NULL, &graph_state, 0, color, fill_mode, alpha_flag, pIccTransform, blend_type);
}
-FX_BOOL CFX_RenderDevice::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform)
+bool CFX_RenderDevice::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform)
{
if (!(m_RenderCaps & FXRC_GET_BITS)) {
- return FALSE;
+ return false;
}
return m_pDeviceDriver->GetDIBits(pBitmap, left, top, pIccTransform);
}
@@ -316,7 +316,7 @@ CFX_DIBitmap* CFX_RenderDevice::GetBackDrop()
{
return m_pDeviceDriver->GetBackDrop();
}
-FX_BOOL CFX_RenderDevice::SetDIBits(const CFX_DIBSource* pBitmap, int left, int top, int blend_mode,
+bool CFX_RenderDevice::SetDIBits(const CFX_DIBSource* pBitmap, int left, int top, int blend_mode,
void* pIccTransform)
{
ASSERT(!pBitmap->IsAlphaMask());
@@ -326,7 +326,7 @@ FX_BOOL CFX_RenderDevice::SetDIBits(const CFX_DIBSource* pBitmap, int left, int
FX_RECT dest_rect(left, top, FXSYS_round(left + pBitmap->GetWidth() / fScaleX), FXSYS_round(top + pBitmap->GetHeight() / fScaleY));
dest_rect.Intersect(m_ClipBox);
if (dest_rect.IsEmpty()) {
- return TRUE;
+ return true;
}
FX_RECT src_rect(dest_rect.left - left, dest_rect.top - top,
dest_rect.left - left + dest_rect.Width(), dest_rect.top - top + dest_rect.Height());
@@ -337,29 +337,29 @@ FX_BOOL CFX_RenderDevice::SetDIBits(const CFX_DIBSource* pBitmap, int left, int
if ((blend_mode != FXDIB_BLEND_NORMAL && !(m_RenderCaps & FXRC_BLEND_MODE)) ||
(pBitmap->HasAlpha() && !(m_RenderCaps & FXRC_ALPHA_IMAGE))) {
if (!(m_RenderCaps & FXRC_GET_BITS)) {
- return FALSE;
+ return false;
}
int bg_pixel_width = FXSYS_round(dest_rect.Width() * fScaleX);
int bg_pixel_height = FXSYS_round(dest_rect.Height() * fScaleY);
CFX_DIBitmap background;
if (!background.Create(bg_pixel_width, bg_pixel_height,
(m_RenderCaps & FXRC_CMYK_OUTPUT) ? FXDIB_Cmyk : FXDIB_Rgb32)) {
- return FALSE;
+ return false;
}
if (!m_pDeviceDriver->GetDIBits(&background, dest_rect.left, dest_rect.top)) {
- return FALSE;
+ return false;
}
if (!background.CompositeBitmap(0, 0, bg_pixel_width, bg_pixel_height,
pBitmap, src_rect.left, src_rect.top,
- blend_mode, NULL, FALSE, pIccTransform)) {
- return FALSE;
+ blend_mode, NULL, false, pIccTransform)) {
+ return false;
}
FX_RECT src_rect(0, 0, bg_pixel_width, bg_pixel_height);
return m_pDeviceDriver->SetDIBits(&background, 0, &src_rect, dest_rect.left, dest_rect.top, FXDIB_BLEND_NORMAL);
}
return m_pDeviceDriver->SetDIBits(pBitmap, 0, &src_rect, dest_rect.left, dest_rect.top, blend_mode, 0, pIccTransform);
}
-FX_BOOL CFX_RenderDevice::StretchDIBits(const CFX_DIBSource* pBitmap, int left, int top,
+bool CFX_RenderDevice::StretchDIBits(const CFX_DIBSource* pBitmap, int left, int top,
int dest_width, int dest_height, FX_DWORD flags,
void* pIccTransform, int blend_mode)
{
@@ -367,17 +367,17 @@ FX_BOOL CFX_RenderDevice::StretchDIBits(const CFX_DIBSource* pBitmap, int left,
FX_RECT clip_box = m_ClipBox;
clip_box.Intersect(dest_rect);
if (clip_box.IsEmpty()) {
- return TRUE;
+ return true;
}
return m_pDeviceDriver->StretchDIBits(pBitmap, 0, left, top, dest_width, dest_height, &clip_box, flags, 0, pIccTransform, blend_mode);
}
-FX_BOOL CFX_RenderDevice::SetBitMask(const CFX_DIBSource* pBitmap, int left, int top, FX_DWORD argb,
+bool CFX_RenderDevice::SetBitMask(const CFX_DIBSource* pBitmap, int left, int top, FX_DWORD argb,
int alpha_flag, void* pIccTransform)
{
FX_RECT src_rect(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight());
return m_pDeviceDriver->SetDIBits(pBitmap, argb, &src_rect, left, top, FXDIB_BLEND_NORMAL, alpha_flag, pIccTransform);
}
-FX_BOOL CFX_RenderDevice::StretchBitMask(const CFX_DIBSource* pBitmap, int left, int top,
+bool CFX_RenderDevice::StretchBitMask(const CFX_DIBSource* pBitmap, int left, int top,
int dest_width, int dest_height, FX_DWORD argb, FX_DWORD flags,
int alpha_flag, void* pIccTransform)
{
@@ -386,13 +386,13 @@ FX_BOOL CFX_RenderDevice::StretchBitMask(const CFX_DIBSource* pBitmap, int left,
clip_box.Intersect(dest_rect);
return m_pDeviceDriver->StretchDIBits(pBitmap, argb, left, top, dest_width, dest_height, &clip_box, flags, alpha_flag, pIccTransform);
}
-FX_BOOL CFX_RenderDevice::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD argb,
+bool CFX_RenderDevice::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD argb,
const CFX_AffineMatrix* pMatrix, FX_DWORD flags, void*& handle,
int alpha_flag, void* pIccTransform, int blend_mode)
{
return m_pDeviceDriver->StartDIBits(pBitmap, bitmap_alpha, argb, pMatrix, flags, handle, alpha_flag, pIccTransform, blend_mode);
}
-FX_BOOL CFX_RenderDevice::ContinueDIBits(void* handle, IFX_Pause* pPause)
+bool CFX_RenderDevice::ContinueDIBits(void* handle, IFX_Pause* pPause)
{
return m_pDeviceDriver->ContinueDIBits(handle, pPause);
}
diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp
index 6a950bf20b..7a5e0ccabd 100644
--- a/core/src/fxge/ge/fx_ge_font.cpp
+++ b/core/src/fxge/ge/fx_ge_font.cpp
@@ -13,8 +13,8 @@ CFX_Font::CFX_Font()
{
m_pSubstFont = NULL;
m_Face = NULL;
- m_bEmbedded = FALSE;
- m_bVertical = FALSE;
+ m_bEmbedded = false;
+ m_bVertical = false;
m_pFontData = NULL;
m_pFontDataAllocation = NULL;
m_dwSize = 0;
@@ -24,7 +24,7 @@ CFX_Font::CFX_Font()
m_pPlatformFontCollection = NULL;
m_pDwFont = NULL;
m_hHandle = NULL;
- m_bDwLoaded = FALSE;
+ m_bDwLoaded = false;
}
CFX_Font::~CFX_Font()
{
@@ -61,10 +61,10 @@ void CFX_Font::DeleteFace()
FXFT_Done_Face(m_Face);
m_Face = NULL;
}
-FX_BOOL CFX_Font::LoadSubst(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags,
- int weight, int italic_angle, int CharsetCP, FX_BOOL bVertical)
+bool CFX_Font::LoadSubst(const CFX_ByteString& face_name, bool bTrueType, FX_DWORD flags,
+ int weight, int italic_angle, int CharsetCP, bool bVertical)
{
- m_bEmbedded = FALSE;
+ m_bEmbedded = false;
m_bVertical = bVertical;
m_pSubstFont = new CFX_SubstFont;
m_Face = CFX_GEModule::Get()->GetFontMgr()->FindSubstFont(face_name, bTrueType, flags, weight, italic_angle,
@@ -79,7 +79,7 @@ FX_BOOL CFX_Font::LoadSubst(const CFX_ByteString& face_name, FX_BOOL bTrueType,
m_pFontData = FXFT_Get_Face_Stream_Base(m_Face);
m_dwSize = FXFT_Get_Face_Stream_Size(m_Face);
}
- return TRUE;
+ return true;
}
extern "C" {
unsigned long _FTStreamRead(FXFT_Stream stream, unsigned long offset,
@@ -99,7 +99,7 @@ extern "C" {
{
}
};
-FX_BOOL _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_Stream* stream)
+bool _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_Stream* stream)
{
FXFT_Stream stream1 = (FXFT_Stream)FX_Alloc(uint8_t, sizeof (FXFT_StreamRec));
stream1->base = NULL;
@@ -113,16 +113,16 @@ FX_BOOL _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FX
args.stream = stream1;
if (FXFT_Open_Face(library, &args, 0, Face)) {
FX_Free(stream1);
- return FALSE;
+ return false;
}
if (stream) {
*stream = stream1;
}
- return TRUE;
+ return true;
}
-FX_BOOL CFX_Font::LoadFile(IFX_FileRead* pFile)
+bool CFX_Font::LoadFile(IFX_FileRead* pFile)
{
- m_bEmbedded = FALSE;
+ m_bEmbedded = false;
FXFT_Library library;
if (CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary == NULL) {
FXFT_Init_FreeType(&CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary);
@@ -130,11 +130,11 @@ FX_BOOL CFX_Font::LoadFile(IFX_FileRead* pFile)
library = CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary;
FXFT_Stream stream = NULL;
if (!_LoadFile(library, &m_Face, pFile, &stream)) {
- return FALSE;
+ return false;
}
m_pOwnedStream = stream;
FXFT_Set_Pixel_Sizes(m_Face, 0, 64);
- return TRUE;
+ return true;
}
int CFX_Font::GetGlyphWidth(FX_DWORD glyph_index)
{
@@ -169,20 +169,20 @@ static FXFT_Face FT_LoadFont(uint8_t* pData, int size)
}
return face;
}
-FX_BOOL CFX_Font::LoadEmbedded(const uint8_t* data, FX_DWORD size)
+bool CFX_Font::LoadEmbedded(const uint8_t* data, FX_DWORD size)
{
m_pFontDataAllocation = FX_Alloc(uint8_t, size);
FXSYS_memcpy(m_pFontDataAllocation, data, size);
m_Face = FT_LoadFont((uint8_t*)m_pFontDataAllocation, size);
m_pFontData = (uint8_t*)m_pFontDataAllocation;
- m_bEmbedded = TRUE;
+ m_bEmbedded = true;
m_dwSize = size;
return m_Face != NULL;
}
-FX_BOOL CFX_Font::IsTTFont()
+bool CFX_Font::IsTTFont()
{
if (m_Face == NULL) {
- return FALSE;
+ return false;
}
return FXFT_Is_Face_TT_OT(m_Face) == FXFT_FACE_FLAG_SFNT;
}
@@ -202,25 +202,25 @@ int CFX_Font::GetDescent() const
int descent = EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_Descender(m_Face));
return descent;
}
-FX_BOOL CFX_Font::GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox)
+bool CFX_Font::GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox)
{
if (m_Face == NULL) {
- return FALSE;
+ return false;
}
if (FXFT_Is_Face_Tricky(m_Face)) {
int error = FXFT_Set_Char_Size(m_Face, 0, 1000 * 64, 72, 72);
if (error) {
- return FALSE;
+ return false;
}
error = FXFT_Load_Glyph(m_Face, glyph_index, FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
if (error) {
- return FALSE;
+ return false;
}
FXFT_BBox cbox;
FT_Glyph glyph;
error = FXFT_Get_Glyph(((FXFT_Face)m_Face)->glyph, &glyph);
if (error) {
- return FALSE;
+ return false;
}
FXFT_Glyph_Get_CBox(glyph, FXFT_GLYPH_BBOX_PIXELS, &cbox);
int pixel_size_x = ((FXFT_Face)m_Face)->size->metrics.x_ppem,
@@ -246,7 +246,7 @@ FX_BOOL CFX_Font::GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox)
return FXFT_Set_Pixel_Sizes(m_Face, 0, 64) == 0;
}
if (FXFT_Load_Glyph(m_Face, glyph_index, FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH)) {
- return FALSE;
+ return false;
}
int em = FXFT_Get_Face_UnitsPerEM(m_Face);
if (em == 0) {
@@ -260,34 +260,34 @@ FX_BOOL CFX_Font::GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox)
bbox.right = (FXFT_Get_Glyph_HoriBearingX(m_Face) + FXFT_Get_Glyph_Width(m_Face)) * 1000 / em;
bbox.bottom = (FXFT_Get_Glyph_HoriBearingY(m_Face)) * 1000 / em;
}
- return TRUE;
+ return true;
}
-FX_BOOL CFX_Font::IsItalic()
+bool CFX_Font::IsItalic()
{
if (m_Face == NULL) {
- return FALSE;
+ return false;
}
- FX_BOOL ret = FXFT_Is_Face_Italic(m_Face) == FXFT_STYLE_FLAG_ITALIC;
+ 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;
+ ret = true;
}
}
return ret;
}
-FX_BOOL CFX_Font::IsBold()
+bool CFX_Font::IsBold()
{
if (m_Face == NULL) {
- return FALSE;
+ return false;
}
return FXFT_Is_Face_Bold(m_Face) == FXFT_STYLE_FLAG_BOLD;
}
-FX_BOOL CFX_Font::IsFixedWidth()
+bool CFX_Font::IsFixedWidth()
{
if (m_Face == NULL) {
- return FALSE;
+ return false;
}
return FXFT_Is_Face_fixedwidth(m_Face);
}
@@ -331,10 +331,10 @@ CFX_ByteString CFX_Font::GetFaceName() const
}
return m_pSubstFont->m_Family;
}
-FX_BOOL CFX_Font::GetBBox(FX_RECT &bbox)
+bool CFX_Font::GetBBox(FX_RECT &bbox)
{
if (m_Face == NULL) {
- return FALSE;
+ return false;
}
int em = FXFT_Get_Face_UnitsPerEM(m_Face);
if (em == 0) {
@@ -348,7 +348,7 @@ FX_BOOL CFX_Font::GetBBox(FX_RECT &bbox)
bbox.right = FXFT_Get_Face_xMax(m_Face) * 1000 / em;
bbox.bottom = FXFT_Get_Face_yMax(m_Face) * 1000 / em;
}
- return TRUE;
+ return true;
}
int CFX_Font::GetHeight()
{
diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp
index 14427a5e40..15f022e86b 100644
--- a/core/src/fxge/ge/fx_ge_fontmap.cpp
+++ b/core/src/fxge/ge/fx_ge_fontmap.cpp
@@ -18,9 +18,9 @@ CFX_SubstFont::CFX_SubstFont()
m_SubstFlags = 0;
m_Weight = 0;
m_ItalicAngle = 0;
- m_bSubstOfCJK = FALSE;
+ m_bSubstOfCJK = false;
m_WeightCJK = 0;
- m_bItlicCJK = FALSE;
+ m_bItlicCJK = false;
}
CTTFontDesc::~CTTFontDesc()
{
@@ -38,11 +38,11 @@ CTTFontDesc::~CTTFontDesc()
FX_Free(m_pFontData);
}
}
-FX_BOOL CTTFontDesc::ReleaseFace(FXFT_Face face)
+bool CTTFontDesc::ReleaseFace(FXFT_Face face)
{
if (m_Type == 1) {
if (m_SingleFace.m_pFace != face) {
- return FALSE;
+ return false;
}
} else if (m_Type == 2) {
int i;
@@ -51,15 +51,15 @@ FX_BOOL CTTFontDesc::ReleaseFace(FXFT_Face face)
break;
}
if (i == 16) {
- return FALSE;
+ return false;
}
}
m_RefCount --;
if (m_RefCount) {
- return FALSE;
+ return false;
}
delete this;
- return TRUE;
+ return true;
}
CFX_FontMgr::CFX_FontMgr()
{
@@ -98,7 +98,7 @@ void CFX_FontMgr::SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo)
{
m_pBuiltinMapper->SetSystemFontInfo(pFontInfo);
}
-FXFT_Face CFX_FontMgr::FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType,
+FXFT_Face CFX_FontMgr::FindSubstFont(const CFX_ByteString& face_name, bool bTrueType,
FX_DWORD flags, int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont)
{
if (m_FTLibrary == NULL) {
@@ -115,7 +115,7 @@ FXFT_Face CFX_FontMgr::FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bT
CharsetCP, pSubstFont);
}
FXFT_Face CFX_FontMgr::GetCachedFace(const CFX_ByteString& face_name,
- int weight, FX_BOOL bItalic, uint8_t*& pFontData)
+ int weight, bool bItalic, uint8_t*& pFontData)
{
CFX_ByteString key(face_name);
key += ',';
@@ -131,7 +131,7 @@ FXFT_Face CFX_FontMgr::GetCachedFace(const CFX_ByteString& face_name,
return NULL;
}
FXFT_Face CFX_FontMgr::AddCachedFace(const CFX_ByteString& face_name,
- int weight, FX_BOOL bItalic, uint8_t* pData, FX_DWORD size, int face_index)
+ int weight, bool bItalic, uint8_t* pData, FX_DWORD size, int face_index)
{
CTTFontDesc* pFontDesc = new CTTFontDesc;
pFontDesc->m_Type = 1;
@@ -433,10 +433,10 @@ void _FPDFAPI_GetInternalFontData(int id, const uint8_t*& data, FX_DWORD& size)
{
CFX_GEModule::Get()->GetFontMgr()->GetStandardFont(data, size, id);
}
-FX_BOOL CFX_FontMgr::GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index)
+bool CFX_FontMgr::GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index)
{
if (index > 15 || index < 0) {
- return FALSE;
+ return false;
}
{
if (index >= 14) {
@@ -452,14 +452,14 @@ FX_BOOL CFX_FontMgr::GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size,
size = g_FoxitFonts[index].m_dwSize;
}
}
- return TRUE;
+ return true;
}
CFX_FontMapper::CFX_FontMapper()
{
FXSYS_memset(m_FoxitFaces, 0, sizeof m_FoxitFaces);
m_MMFaces[0] = m_MMFaces[1] = NULL;
m_pFontInfo = NULL;
- m_bListLoaded = FALSE;
+ m_bListLoaded = false;
m_pFontEnumerator = NULL;
}
CFX_FontMapper::~CFX_FontMapper()
@@ -583,10 +583,10 @@ void CFX_FontMapper::AddInstalledFont(const CFX_ByteString& name, int charset)
return;
}
const uint8_t* ptr = name;
- FX_BOOL bLocalized = FALSE;
+ bool bLocalized = false;
for (int i = 0; i < name.GetLength(); i ++)
if (ptr[i] > 0x80) {
- bLocalized = TRUE;
+ bLocalized = true;
break;
}
if (bLocalized) {
@@ -620,7 +620,7 @@ void CFX_FontMapper::LoadInstalledFonts()
return;
}
m_pFontInfo->EnumFontList(this);
- m_bListLoaded = TRUE;
+ m_bListLoaded = true;
}
CFX_ByteString CFX_FontMapper::MatchInstalledFonts(const CFX_ByteString& norm_name)
{
@@ -847,7 +847,7 @@ CFX_ByteString ParseStyle(const FX_CHAR* pStyle, int iLen, int iIndex)
}
return buf.GetByteString();
}
-int32_t GetStyleType(const CFX_ByteString &bsStyle, FX_BOOL bRevert)
+int32_t GetStyleType(const CFX_ByteString &bsStyle, bool bRevert)
{
int32_t iLen = bsStyle.GetLength();
if (!iLen) {
@@ -872,15 +872,15 @@ int32_t GetStyleType(const CFX_ByteString &bsStyle, FX_BOOL bRevert)
}
return -1;
}
-FX_BOOL CheckSupportThirdPartFont(CFX_ByteString name, int &PitchFamily)
+bool CheckSupportThirdPartFont(CFX_ByteString name, int &PitchFamily)
{
if (name == FX_BSTRC("MyriadPro")) {
PitchFamily &= ~FXFONT_FF_ROMAN;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTrueType, FX_DWORD flags,
+FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueType, FX_DWORD flags,
int weight, int italic_angle, int WindowCP, CFX_SubstFont* pSubstFont)
{
if (!(flags & FXFONT_USEEXTERNATTR)) {
@@ -923,14 +923,14 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
}
int iBaseFont = 0;
CFX_ByteString family, style;
- FX_BOOL bHasComma = FALSE;
- FX_BOOL bHasHypen = FALSE;
+ bool bHasComma = false;
+ bool bHasHypen = false;
int find = SubstName.Find(FX_BSTRC(","), 0);
if (find >= 0) {
family = SubstName.Left(find);
_PDF_GetStandardFontName(family);
style = SubstName.Mid(find + 1);
- bHasComma = TRUE;
+ bHasComma = true;
} else {
family = SubstName;
}
@@ -939,9 +939,9 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
break;
}
int PitchFamily = 0;
- FX_BOOL bItalic = FALSE;
+ bool bItalic = false;
FX_DWORD nStyle = 0;
- FX_BOOL bStyleAvail = FALSE;
+ bool bStyleAvail = false;
if (iBaseFont < 12) {
family = g_Base14FontNames[iBaseFont];
if ((iBaseFont % 4) == 1 || (iBaseFont % 4) == 2) {
@@ -962,12 +962,12 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
if (find >= 0) {
style = family.Mid(find + 1);
family = family.Left(find);
- bHasHypen = TRUE;
+ bHasHypen = true;
}
}
if (!bHasHypen) {
int nLen = family.GetLength();
- int32_t nRet = GetStyleType(family, TRUE);
+ int32_t nRet = GetStyleType(family, true);
if (nRet > -1) {
family = family.Left(nLen - g_FontStyles[nRet].len);
if (nRet == 0) {
@@ -995,17 +995,17 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
int nLen = style.GetLength();
const FX_CHAR* pStyle = style;
int i = 0;
- FX_BOOL bFirstItem = TRUE;
+ bool bFirstItem = true;
CFX_ByteString buf;
while (i < nLen) {
buf = ParseStyle(pStyle, nLen, i);
- int32_t nRet = GetStyleType(buf, FALSE);
+ int32_t nRet = GetStyleType(buf, false);
if ((i && !bStyleAvail) || (!i && nRet < 0)) {
family = SubstName;
iBaseFont = 12;
break;
} else if (nRet >= 0) {
- bStyleAvail = TRUE;
+ bStyleAvail = true;
}
if (nRet == 0) {
if (nStyle & FX_FONT_STYLE_Bold) {
@@ -1013,7 +1013,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
} else {
nStyle |= FX_FONT_STYLE_Bold;
}
- bFirstItem = FALSE;
+ bFirstItem = false;
}
if (nRet == 1) {
if (bFirstItem) {
@@ -1031,7 +1031,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
} else {
nStyle |= FX_FONT_STYLE_Bold;
}
- bFirstItem = FALSE;
+ bFirstItem = false;
}
i += buf.GetLength() + 1;
}
@@ -1042,9 +1042,9 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
weight = nStyle & FX_FONT_STYLE_BoldBold ? 900 : (nStyle & FX_FONT_STYLE_Bold ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL);
}
if (nStyle & FX_FONT_STYLE_Italic) {
- bItalic = TRUE;
+ bItalic = true;
}
- FX_BOOL bCJK = FALSE;
+ bool bCJK = false;
int iExact = 0;
int Charset = FXFONT_ANSI_CHARSET;
if (WindowCP) {
@@ -1054,7 +1054,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
}
if (Charset == FXFONT_SHIFTJIS_CHARSET || Charset == FXFONT_GB2312_CHARSET ||
Charset == FXFONT_HANGEUL_CHARSET || Charset == FXFONT_CHINESEBIG5_CHARSET) {
- bCJK = TRUE;
+ bCJK = true;
}
if (m_pFontInfo == NULL) {
pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD;
@@ -1069,21 +1069,21 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
if (!bCJK) {
if (!CheckSupportThirdPartFont(family, PitchFamily)) {
if (italic_angle != 0) {
- bItalic = TRUE;
+ bItalic = true;
} else {
- bItalic = FALSE;
+ bItalic = false;
}
weight = old_weight;
}
} else {
- pSubstFont->m_bSubstOfCJK = TRUE;
+ pSubstFont->m_bSubstOfCJK = true;
if (nStyle) {
pSubstFont->m_WeightCJK = weight;
} else {
pSubstFont->m_WeightCJK = FXFONT_FW_NORMAL;
}
if (nStyle & FX_FONT_STYLE_Italic) {
- pSubstFont->m_bItlicCJK = TRUE;
+ pSubstFont->m_bItlicCJK = true;
}
}
} else {
@@ -1123,7 +1123,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
}
} else {
if (flags & FXFONT_ITALIC) {
- bItalic = TRUE;
+ bItalic = true;
}
}
iExact = !match.IsEmpty();
@@ -1134,9 +1134,9 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
if (hFont == NULL) {
if (bCJK) {
if (italic_angle != 0) {
- bItalic = TRUE;
+ bItalic = true;
} else {
- bItalic = FALSE;
+ bItalic = false;
}
weight = old_weight;
}
@@ -1221,18 +1221,18 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
}
pSubstFont->m_Family = SubstName;
pSubstFont->m_Charset = Charset;
- FX_BOOL bNeedUpdateWeight = FALSE;
+ bool bNeedUpdateWeight = false;
if (FXFT_Is_Face_Bold(face)) {
if (weight == FXFONT_FW_BOLD) {
- bNeedUpdateWeight = FALSE;
+ bNeedUpdateWeight = false;
} else {
- bNeedUpdateWeight = TRUE;
+ bNeedUpdateWeight = true;
}
} else {
if (weight == FXFONT_FW_NORMAL) {
- bNeedUpdateWeight = FALSE;
+ bNeedUpdateWeight = false;
} else {
- bNeedUpdateWeight = TRUE;
+ bNeedUpdateWeight = true;
}
}
if (bNeedUpdateWeight) {
@@ -1262,7 +1262,7 @@ CFontFileFaceInfo::CFontFileFaceInfo()
m_FileSize = 0;
m_FontOffset = 0;
m_Weight = 0;
- m_bItalic = FALSE;
+ m_bItalic = false;
m_PitchFamily = 0;
}
CFontFileFaceInfo::~CFontFileFaceInfo()
@@ -1272,7 +1272,7 @@ CFontFileFaceInfo::~CFontFileFaceInfo()
}
m_Face = NULL;
}
-extern FX_BOOL _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_Stream* stream);
+extern bool _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_Stream* stream);
#if _FX_OS_ == _FX_ANDROID_
IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
{
@@ -1300,13 +1300,13 @@ void CFX_FolderFontInfo::Release()
{
delete this;
}
-FX_BOOL CFX_FolderFontInfo::EnumFontList(CFX_FontMapper* pMapper)
+bool CFX_FolderFontInfo::EnumFontList(CFX_FontMapper* pMapper)
{
m_pMapper = pMapper;
for (int i = 0; i < m_PathList.GetSize(); i ++) {
ScanPath(m_PathList[i]);
}
- return TRUE;
+ return true;
}
void CFX_FolderFontInfo::ScanPath(CFX_ByteString& path)
{
@@ -1315,7 +1315,7 @@ void CFX_FolderFontInfo::ScanPath(CFX_ByteString& path)
return;
}
CFX_ByteString filename;
- FX_BOOL bFolder;
+ bool bFolder;
while (FX_GetNextFile(handle, filename, bFolder)) {
if (bFolder) {
if (filename == "." || filename == "..") {
@@ -1451,7 +1451,7 @@ void CFX_FolderFontInfo::ReportFace(CFX_ByteString& path, FXSYS_FILE* pFile, FX_
}
m_FontList.SetAt(facename, pInfo);
}
-void* CFX_FolderFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, int& iExact)
+void* CFX_FolderFontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* family, int& iExact)
{
return NULL;
}
@@ -1506,16 +1506,16 @@ FX_DWORD CFX_FolderFontInfo::GetFontData(void* hFont, FX_DWORD table, uint8_t* b
void CFX_FolderFontInfo::DeleteFont(void* hFont)
{
}
-FX_BOOL CFX_FolderFontInfo::GetFaceName(void* hFont, CFX_ByteString& name)
+bool CFX_FolderFontInfo::GetFaceName(void* hFont, CFX_ByteString& name)
{
if (hFont == NULL) {
- return FALSE;
+ return false;
}
CFontFaceInfo* pFont = (CFontFaceInfo*)hFont;
name = pFont->m_FaceName;
- return TRUE;
+ return true;
}
-FX_BOOL CFX_FolderFontInfo::GetFontCharset(void* hFont, int& charset)
+bool CFX_FolderFontInfo::GetFontCharset(void* hFont, int& charset)
{
- return FALSE;
+ return false;
}
diff --git a/core/src/fxge/ge/fx_ge_linux.cpp b/core/src/fxge/ge/fx_ge_linux.cpp
index 861afd259c..9f493a6cfc 100644
--- a/core/src/fxge/ge/fx_ge_linux.cpp
+++ b/core/src/fxge/ge/fx_ge_linux.cpp
@@ -30,9 +30,9 @@ Base14Substs[] = {
class CFX_LinuxFontInfo : public CFX_FolderFontInfo
{
public:
- void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, int& iExact) override;
- FX_BOOL ParseFontCfg();
- void* FindFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, FX_BOOL bMatchName);
+ void* MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* family, int& iExact) override;
+ bool ParseFontCfg();
+ void* FindFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* family, bool bMatchName);
};
#define LINUX_GPNAMESIZE 6
static const struct {
@@ -77,7 +77,7 @@ static int32_t GetJapanesePreference(const FX_CHAR* facearr, int weight, int pic
}
return 2;
}
-void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, int& iExact)
+void* CFX_LinuxFontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, int& iExact)
{
CFX_ByteString face = cstr_face;
int iBaseFont;
@@ -91,7 +91,7 @@ void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int p
return GetFont(face);
}
void* p = NULL;
- FX_BOOL bCJK = TRUE;
+ bool bCJK = true;
switch (charset) {
case FXFONT_SHIFTJIS_CHARSET: {
int32_t index = GetJapanesePreference(cstr_face, weight, pitch_family);
@@ -129,7 +129,7 @@ void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int p
}
break;
default:
- bCJK = FALSE;
+ bCJK = false;
break;
}
if (charset == FXFONT_ANSI_CHARSET && (pitch_family & FXFONT_FF_FIXEDPITCH)) {
@@ -157,7 +157,7 @@ static FX_DWORD _LinuxGetCharset(int charset)
}
return 0;
}
-static int32_t _LinuxGetSimilarValue(int weight, FX_BOOL bItalic, int pitch_family, FX_DWORD style)
+static int32_t _LinuxGetSimilarValue(int weight, bool bItalic, int pitch_family, FX_DWORD style)
{
int32_t iSimilarValue = 0;
if ((style & FXFONT_BOLD) == (weight > 400)) {
@@ -177,7 +177,7 @@ static int32_t _LinuxGetSimilarValue(int weight, FX_BOOL bItalic, int pitch_fami
}
return iSimilarValue;
}
-void* CFX_LinuxFontInfo::FindFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, FX_BOOL bMatchName)
+void* CFX_LinuxFontInfo::FindFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* family, bool bMatchName)
{
CFontFaceInfo* pFind = NULL;
FX_DWORD charset_flag = _LinuxGetCharset(charset);
@@ -217,9 +217,9 @@ IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
}
return pInfo;
}
-FX_BOOL CFX_LinuxFontInfo::ParseFontCfg()
+bool CFX_LinuxFontInfo::ParseFontCfg()
{
- return FALSE;
+ return false;
}
void CFX_GEModule::InitPlatform()
{
diff --git a/core/src/fxge/ge/fx_ge_path.cpp b/core/src/fxge/ge/fx_ge_path.cpp
index b1410b3911..4bc9a88128 100644
--- a/core/src/fxge/ge/fx_ge_path.cpp
+++ b/core/src/fxge/ge/fx_ge_path.cpp
@@ -110,7 +110,7 @@ void CFX_ClipRgn::IntersectMaskF(int left, int top, CFX_DIBitmapRef Mask)
m_Mask = new_mask;
return;
}
- ASSERT(FALSE);
+ ASSERT(false);
}
CFX_PathData::CFX_PathData()
{
@@ -257,8 +257,8 @@ static void _UpdateLineJoinPoints(CFX_FloatRect& rect, FX_FLOAT start_x, FX_FLOA
FX_FLOAT half_width, FX_FLOAT miter_limit)
{
FX_FLOAT start_k = 0, start_c = 0, end_k = 0, end_c = 0, start_len = 0, start_dc = 0, end_len = 0, end_dc = 0;
- FX_BOOL bStartVert = FXSYS_fabs(start_x - middle_x) < 1.0f / 20;
- FX_BOOL bEndVert = FXSYS_fabs(middle_x - end_x) < 1.0f / 20;
+ bool bStartVert = FXSYS_fabs(start_x - middle_x) < 1.0f / 20;
+ bool bEndVert = FXSYS_fabs(middle_x - end_x) < 1.0f / 20;
if (bStartVert && bEndVert) {
int start_dir = middle_y > start_y ? 1 : -1;
FX_FLOAT point_y = middle_y + half_width * start_dir;
@@ -342,12 +342,12 @@ CFX_FloatRect CFX_PathData::GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_l
int iPoint = 0;
FX_FLOAT half_width = line_width;
int iStartPoint, iEndPoint, iMiddlePoint;
- FX_BOOL bJoin;
+ bool bJoin;
while (iPoint < m_PointCount) {
if (m_pPoints[iPoint].m_Flag == FXPT_MOVETO) {
iStartPoint = iPoint + 1;
iEndPoint = iPoint;
- bJoin = FALSE;
+ bJoin = false;
} else {
if (m_pPoints[iPoint].m_Flag == FXPT_BEZIERTO) {
rect.UpdateRect(m_pPoints[iPoint].m_PointX, m_pPoints[iPoint].m_PointY);
@@ -357,12 +357,12 @@ CFX_FloatRect CFX_PathData::GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_l
if (iPoint == m_PointCount - 1 || m_pPoints[iPoint + 1].m_Flag == FXPT_MOVETO) {
iStartPoint = iPoint - 1;
iEndPoint = iPoint;
- bJoin = FALSE;
+ bJoin = false;
} else {
iStartPoint = iPoint - 1;
iMiddlePoint = iPoint;
iEndPoint = iPoint + 1;
- bJoin = TRUE;
+ bJoin = true;
}
}
FX_FLOAT start_x = m_pPoints[iStartPoint].m_PointX;
@@ -389,10 +389,10 @@ void CFX_PathData::Transform(const CFX_AffineMatrix* pMatrix)
pMatrix->Transform(m_pPoints[i].m_PointX, m_pPoints[i].m_PointY);
}
}
-FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMatrix, FX_BOOL&bThin, FX_BOOL bAdjust) const
+bool CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMatrix, bool&bThin, bool bAdjust) const
{
if (m_PointCount < 3) {
- return FALSE;
+ return false;
}
if (m_PointCount == 3 && (m_pPoints[0].m_Flag & FXPT_TYPE) == FXPT_MOVETO &&
(m_pPoints[1].m_Flag & FXPT_TYPE) == FXPT_LINETO && (m_pPoints[2].m_Flag & FXPT_TYPE) == FXPT_LINETO
@@ -422,19 +422,19 @@ FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* p
NewPath.SetPoint(1, m_pPoints[1].m_PointX, m_pPoints[1].m_PointY, FXPT_LINETO);
}
if (m_pPoints[0].m_PointX != m_pPoints[1].m_PointX && m_pPoints[0].m_PointY != m_pPoints[1].m_PointY) {
- bThin = TRUE;
+ bThin = true;
}
- return TRUE;
+ return true;
}
if (((m_PointCount > 3) && (m_PointCount % 2))) {
int mid = m_PointCount / 2;
- FX_BOOL bZeroArea = FALSE;
+ bool bZeroArea = false;
CFX_PathData t_path;
for (int i = 0; i < mid; i++) {
if (!(m_pPoints[mid - i - 1].m_PointX == m_pPoints[mid + i + 1].m_PointX
&& m_pPoints[mid - i - 1].m_PointY == m_pPoints[mid + i + 1].m_PointY &&
((m_pPoints[mid - i - 1].m_Flag & FXPT_TYPE) != FXPT_BEZIERTO && (m_pPoints[mid + i + 1].m_Flag & FXPT_TYPE) != FXPT_BEZIERTO))) {
- bZeroArea = TRUE;
+ bZeroArea = true;
break;
}
int new_count = t_path.GetPointCount();
@@ -444,8 +444,8 @@ FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* p
}
if (!bZeroArea) {
NewPath.Append(&t_path, NULL);
- bThin = TRUE;
- return TRUE;
+ bThin = true;
+ return true;
}
}
int stratPoint = 0;
@@ -488,7 +488,7 @@ FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* p
NewPath.AddPointCount(2);
NewPath.SetPoint(new_count, m_pPoints[i - 1].m_PointX, m_pPoints[i - 1].m_PointY, FXPT_MOVETO);
NewPath.SetPoint(new_count + 1, m_pPoints[i].m_PointX, m_pPoints[i].m_PointY, FXPT_LINETO);
- bThin = TRUE;
+ bThin = true;
}
}
} else if (point_type == FXPT_BEZIERTO) {
@@ -497,42 +497,42 @@ FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* p
}
}
if (m_PointCount > 3 && NewPath.GetPointCount()) {
- bThin = TRUE;
+ bThin = true;
}
if (NewPath.GetPointCount() == 0) {
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
-FX_BOOL CFX_PathData::IsRect() const
+bool CFX_PathData::IsRect() const
{
if (m_PointCount != 5 && m_PointCount != 4) {
- return FALSE;
+ return false;
}
if ((m_PointCount == 5 && (m_pPoints[0].m_PointX != m_pPoints[4].m_PointX ||
m_pPoints[0].m_PointY != m_pPoints[4].m_PointY)) ||
(m_pPoints[0].m_PointX == m_pPoints[2].m_PointX && m_pPoints[0].m_PointY == m_pPoints[2].m_PointY) ||
(m_pPoints[1].m_PointX == m_pPoints[3].m_PointX && m_pPoints[1].m_PointY == m_pPoints[3].m_PointY)) {
- return FALSE;
+ return false;
}
if (m_pPoints[0].m_PointX != m_pPoints[3].m_PointX && m_pPoints[0].m_PointY != m_pPoints[3].m_PointY) {
- return FALSE;
+ return false;
}
for (int i = 1; i < 4; i ++) {
if ((m_pPoints[i].m_Flag & FXPT_TYPE) != FXPT_LINETO) {
- return FALSE;
+ return false;
}
if (m_pPoints[i].m_PointX != m_pPoints[i - 1].m_PointX && m_pPoints[i].m_PointY != m_pPoints[i - 1].m_PointY) {
- return FALSE;
+ return false;
}
}
return m_PointCount == 5 || (m_pPoints[3].m_Flag & FXPT_CLOSEFIGURE);
}
-FX_BOOL CFX_PathData::IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* pRect) const
+bool CFX_PathData::IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* pRect) const
{
if (pMatrix == NULL) {
if (!IsRect()) {
- return FALSE;
+ return false;
}
if (pRect) {
pRect->left = m_pPoints[0].m_PointX;
@@ -541,27 +541,27 @@ FX_BOOL CFX_PathData::IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* pRe
pRect->top = m_pPoints[2].m_PointY;
pRect->Normalize();
}
- return TRUE;
+ return true;
}
if (m_PointCount != 5 && m_PointCount != 4) {
- return FALSE;
+ return false;
}
if ((m_PointCount == 5 && (m_pPoints[0].m_PointX != m_pPoints[4].m_PointX || m_pPoints[0].m_PointY != m_pPoints[4].m_PointY)) ||
(m_pPoints[1].m_PointX == m_pPoints[3].m_PointX && m_pPoints[1].m_PointY == m_pPoints[3].m_PointY)) {
- return FALSE;
+ return false;
}
if (m_PointCount == 4 && m_pPoints[0].m_PointX != m_pPoints[3].m_PointX && m_pPoints[0].m_PointY != m_pPoints[3].m_PointY) {
- return FALSE;
+ return false;
}
FX_FLOAT x[5], y[5];
for (int i = 0; i < m_PointCount; i ++) {
pMatrix->Transform(m_pPoints[i].m_PointX, m_pPoints[i].m_PointY, x[i], y[i]);
if (i) {
if ((m_pPoints[i].m_Flag & FXPT_TYPE) != FXPT_LINETO) {
- return FALSE;
+ return false;
}
if (x[i] != x[i - 1] && y[i] != y[i - 1]) {
- return FALSE;
+ return false;
}
}
}
@@ -572,7 +572,7 @@ FX_BOOL CFX_PathData::IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* pRe
pRect->top = y[2];
pRect->Normalize();
}
- return TRUE;
+ return true;
}
void CFX_PathData::Copy(const CFX_PathData &src)
{
diff --git a/core/src/fxge/ge/fx_ge_ps.cpp b/core/src/fxge/ge/fx_ge_ps.cpp
index ba5c5fbabb..e375288247 100644
--- a/core/src/fxge/ge/fx_ge_ps.cpp
+++ b/core/src/fxge/ge/fx_ge_ps.cpp
@@ -10,7 +10,7 @@
struct PSGlyph {
CFX_Font* m_pFont;
FX_DWORD m_GlyphIndex;
- FX_BOOL m_bGlyphAdjust;
+ bool m_bGlyphAdjust;
FX_FLOAT m_AdjustMatrix[4];
};
class CPSFont
@@ -22,8 +22,8 @@ public:
CFX_PSRenderer::CFX_PSRenderer()
{
m_pOutput = NULL;
- m_bColorSet = m_bGraphStateSet = FALSE;
- m_bInited = FALSE;
+ m_bColorSet = m_bGraphStateSet = false;
+ m_bInited = false;
}
CFX_PSRenderer::~CFX_PSRenderer()
{
@@ -33,7 +33,7 @@ CFX_PSRenderer::~CFX_PSRenderer()
}
}
#define OUTPUT_PS(str) m_pOutput->OutputPS(str, sizeof str-1)
-void CFX_PSRenderer::Init(IFX_PSOutput* pOutput, int pslevel, int width, int height, FX_BOOL bCmykOutput)
+void CFX_PSRenderer::Init(IFX_PSOutput* pOutput, int pslevel, int width, int height, bool bCmykOutput)
{
m_PSLevel = pslevel;
m_pOutput = pOutput;
@@ -42,10 +42,10 @@ void CFX_PSRenderer::Init(IFX_PSOutput* pOutput, int pslevel, int width, int hei
m_ClipBox.bottom = height;
m_bCmykOutput = bCmykOutput;
}
-FX_BOOL CFX_PSRenderer::StartRendering()
+bool CFX_PSRenderer::StartRendering()
{
if (m_bInited) {
- return TRUE;
+ return true;
}
static const char init_str[] = "\nsave\n/im/initmatrix load def\n"
"/n/newpath load def/m/moveto load def/l/lineto load def/c/curveto load def/h/closepath load def\n"
@@ -57,15 +57,15 @@ FX_BOOL CFX_PSRenderer::StartRendering()
"/cm/concat load def/Cm/currentmatrix load def/mx/matrix load def/sm/setmatrix load def\n"
;
OUTPUT_PS(init_str);
- m_bInited = TRUE;
- return TRUE;
+ m_bInited = true;
+ return true;
}
void CFX_PSRenderer::EndRendering()
{
if (m_bInited) {
OUTPUT_PS("\nrestore\n");
}
- m_bInited = FALSE;
+ m_bInited = false;
}
void CFX_PSRenderer::SaveState()
{
@@ -73,7 +73,7 @@ void CFX_PSRenderer::SaveState()
OUTPUT_PS("q\n");
m_ClipBoxStack.Add(m_ClipBox);
}
-void CFX_PSRenderer::RestoreState(FX_BOOL bKeepSaved)
+void CFX_PSRenderer::RestoreState(bool bKeepSaved)
{
StartRendering();
if (bKeepSaved) {
@@ -81,7 +81,7 @@ void CFX_PSRenderer::RestoreState(FX_BOOL bKeepSaved)
} else {
OUTPUT_PS("Q\n");
}
- m_bColorSet = m_bGraphStateSet = FALSE;
+ m_bColorSet = m_bGraphStateSet = false;
m_ClipBox = m_ClipBoxStack.GetAt(m_ClipBoxStack.GetSize() - 1);
if (!bKeepSaved) {
m_ClipBoxStack.RemoveAt(m_ClipBoxStack.GetSize() - 1);
@@ -175,7 +175,7 @@ void CFX_PSRenderer::SetClip_PathStroke(const CFX_PathData* pPathData,
OUTPUT_PS("strokepath W n\n");
}
}
-FX_BOOL CFX_PSRenderer::DrawPath(const CFX_PathData* pPathData,
+bool CFX_PSRenderer::DrawPath(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
FX_DWORD fill_color,
@@ -189,13 +189,13 @@ FX_BOOL CFX_PSRenderer::DrawPath(const CFX_PathData* pPathData,
int fill_alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(fill_color);
int stroke_alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_STROKE(alpha_flag) : FXARGB_A(stroke_color);
if (fill_alpha && fill_alpha < 255) {
- return FALSE;
+ return false;
}
if (stroke_alpha && stroke_alpha < 255) {
- return FALSE;
+ return false;
}
if (fill_alpha == 0 && stroke_alpha == 0) {
- return FALSE;
+ return false;
}
if (stroke_alpha) {
SetGraphState(pGraphState);
@@ -233,7 +233,7 @@ FX_BOOL CFX_PSRenderer::DrawPath(const CFX_PathData* pPathData,
}
}
OUTPUT_PS("\n");
- return TRUE;
+ return true;
}
void CFX_PSRenderer::SetGraphState(const CFX_GraphStateData* pGraphState)
{
@@ -259,7 +259,7 @@ void CFX_PSRenderer::SetGraphState(const CFX_GraphStateData* pGraphState)
buf << pGraphState->m_MiterLimit << FX_BSTRC(" M\n");
}
m_CurGraphState.Copy(*pGraphState);
- m_bGraphStateSet = TRUE;
+ m_bGraphStateSet = true;
if (buf.GetSize()) {
m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
}
@@ -305,7 +305,7 @@ static void PSCompressData(int PSLevel, uint8_t* src_buf, FX_DWORD src_size,
}
}
}
-FX_BOOL CFX_PSRenderer::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int left, int top,
+bool CFX_PSRenderer::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int left, int top,
int alpha_flag, void* pIccTransform)
{
StartRendering();
@@ -313,7 +313,7 @@ FX_BOOL CFX_PSRenderer::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
(FX_FLOAT)(left), (FX_FLOAT)(top + pSource->GetHeight()));
return DrawDIBits(pSource, color, &matrix, 0, alpha_flag, pIccTransform);
}
-FX_BOOL CFX_PSRenderer::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
+bool CFX_PSRenderer::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
int dest_width, int dest_height, FX_DWORD flags,
int alpha_flag, void* pIccTransform)
{
@@ -322,20 +322,20 @@ FX_BOOL CFX_PSRenderer::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD col
(FX_FLOAT)(dest_left), (FX_FLOAT)(dest_top + dest_height));
return DrawDIBits(pSource, color, &matrix, flags, alpha_flag, pIccTransform);
}
-FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
+bool CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
const CFX_AffineMatrix* pMatrix, FX_DWORD flags,
int alpha_flag, void* pIccTransform)
{
StartRendering();
if ((pMatrix->a == 0 && pMatrix->b == 0) || (pMatrix->c == 0 && pMatrix->d == 0)) {
- return TRUE;
+ return true;
}
if (pSource->HasAlpha()) {
- return FALSE;
+ return false;
}
int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(color) : FXARGB_A(color);
if (pSource->IsAlphaMask() && (alpha < 255 || pSource->GetBPP() != 1)) {
- return FALSE;
+ return false;
}
OUTPUT_PS("q\n");
CFX_ByteTextBuf buf;
@@ -358,7 +358,7 @@ FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
FaxCompressData(src_buf, width, height, output_buf, output_size);
if (pSource->IsAlphaMask()) {
SetColor(color, alpha_flag, pIccTransform);
- m_bColorSet = FALSE;
+ m_bColorSet = false;
buf << FX_BSTRC(" true[");
} else {
buf << FX_BSTRC(" 1[");
@@ -406,7 +406,7 @@ FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
}
if (pConverted == NULL) {
OUTPUT_PS("\nQ\n");
- return FALSE;
+ return false;
}
int Bpp = pConverted->GetBPP() / 8;
uint8_t* output_buf = NULL;
@@ -462,14 +462,14 @@ FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
FX_Free(output_buf);
}
OUTPUT_PS("\nQ\n");
- return TRUE;
+ return true;
}
void CFX_PSRenderer::SetColor(FX_DWORD color, int alpha_flag, void* pIccTransform)
{
if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
pIccTransform = NULL;
}
- FX_BOOL bCMYK = FALSE;
+ bool bCMYK = false;
if (pIccTransform) {
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
color = FXGETFLAG_COLORTYPE(alpha_flag) ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
@@ -490,7 +490,7 @@ void CFX_PSRenderer::SetColor(FX_DWORD color, int alpha_flag, void* pIccTransfor
<< FXARGB_B(color) / 255.0 << FX_BSTRC(" rg\n");
}
if (bCMYK == m_bCmykOutput) {
- m_bColorSet = TRUE;
+ m_bColorSet = true;
m_LastColor = color;
}
m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
@@ -588,7 +588,7 @@ void CFX_PSRenderer::FindPSFontGlyph(CFX_FaceCache* pFaceCache, CFX_Font* pFont,
<< FX_BSTRC("/") << ps_glyphindex << FX_BSTRC(" put\n");
m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
}
-FX_BOOL CFX_PSRenderer::DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+bool CFX_PSRenderer::DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device,
FX_FLOAT font_size, FX_DWORD color,
int alpha_flag, void* pIccTransform)
@@ -596,10 +596,10 @@ FX_BOOL CFX_PSRenderer::DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX
StartRendering();
int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
if (alpha < 255) {
- return FALSE;
+ return false;
}
if ((pObject2Device->a == 0 && pObject2Device->b == 0) || (pObject2Device->c == 0 && pObject2Device->d == 0)) {
- return TRUE;
+ return true;
}
SetColor(color, alpha_flag, pIccTransform);
CFX_ByteTextBuf buf;
@@ -628,7 +628,7 @@ FX_BOOL CFX_PSRenderer::DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX
}
buf << FX_BSTRC("Q\n");
m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
- return TRUE;
+ return true;
}
void CFX_PSRenderer::WritePSBinary(const uint8_t* data, int len)
{
diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp
index 59a4cfb37d..c5da66a4ce 100644
--- a/core/src/fxge/ge/fx_ge_text.cpp
+++ b/core/src/fxge/ge/fx_ge_text.cpp
@@ -46,7 +46,7 @@ private:
FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars, int anti_alias, FX_FLOAT retinaScaleX, FX_FLOAT retinaScaleY)
{
FX_RECT rect(0, 0, 0, 0);
- FX_BOOL bStarted = FALSE;
+ bool bStarted = false;
for (int iChar = 0; iChar < nChars; iChar ++) {
FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar];
const CFX_GlyphBitmap* pGlyph = glyph.m_pGlyph;
@@ -66,7 +66,7 @@ FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars, int anti_a
rect.right = char_right;
rect.top = char_top;
rect.bottom = char_bottom;
- bStarted = TRUE;
+ bStarted = true;
} else {
if (rect.left > char_left) {
rect.left = char_left;
@@ -87,9 +87,9 @@ FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars, int anti_a
static void _AdjustGlyphSpace(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars)
{
ASSERT(nChars > 1);
- FX_BOOL bVertical = FALSE;
+ bool bVertical = false;
if (pGlyphAndPos[nChars - 1].m_OriginX == pGlyphAndPos[0].m_OriginX) {
- bVertical = TRUE;
+ bVertical = true;
} else if (pGlyphAndPos[nChars - 1].m_OriginY != pGlyphAndPos[0].m_OriginY) {
return;
}
@@ -155,7 +155,7 @@ void _Color2Argb(FX_ARGB& argb, FX_DWORD color, int alpha_flag, void* pIccTransf
bgra[3] = (alpha_flag >> 24) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXGETFLAG_ALPHA_STROKE(alpha_flag);
argb = FXARGB_MAKE(bgra[3], bgra[2], bgra[1], bgra[0]);
}
-FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos,
+bool CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos,
CFX_Font* pFont, CFX_FontCache* pCache,
FX_FLOAT font_size, const CFX_AffineMatrix* pText2Device,
FX_DWORD fill_color, FX_DWORD text_flags,
@@ -171,12 +171,12 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
#endif
#endif
if (m_pDeviceDriver->DrawDeviceText(nChars, pCharPos, pFont, pCache, pText2Device, font_size, fill_color, alpha_flag, pIccTransform)) {
- return TRUE;
+ return true;
}
}
int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(fill_color);
if (alpha < 255) {
- return FALSE;
+ return false;
}
} else if (!(text_flags & FXTEXT_NO_NATIVETEXT)) {
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
@@ -186,7 +186,7 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
#endif
#endif
if (m_pDeviceDriver->DrawDeviceText(nChars, pCharPos, pFont, pCache, pText2Device, font_size, fill_color, alpha_flag, pIccTransform)) {
- return TRUE;
+ return true;
}
}
CFX_AffineMatrix char2device, deviceCtm, text2Device;
@@ -204,24 +204,24 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
}
}
int anti_alias = FXFT_RENDER_MODE_MONO;
- FX_BOOL bNormal = FALSE;
+ bool bNormal = false;
if ((text_flags & FXTEXT_NOSMOOTH) == 0) {
if (m_DeviceClass == FXDC_DISPLAY && m_bpp > 1) {
- FX_BOOL bClearType;
+ bool bClearType;
if (pFont->GetFace() == NULL && !(pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_CLEARTYPE)) {
- bClearType = FALSE;
+ bClearType = false;
} else {
bClearType = text_flags & FXTEXT_CLEARTYPE;
}
if ((m_RenderCaps & (FXRC_ALPHA_OUTPUT | FXRC_CMYK_OUTPUT))) {
anti_alias = FXFT_RENDER_MODE_LCD;
- bNormal = TRUE;
+ bNormal = true;
} else if (m_bpp < 16) {
anti_alias = FXFT_RENDER_MODE_NORMAL;
} else {
- if (bClearType == FALSE) {
+ if (bClearType == false) {
anti_alias = FXFT_RENDER_MODE_LCD;
- bNormal = TRUE;
+ bNormal = true;
} else {
anti_alias = FXFT_RENDER_MODE_LCD;
}
@@ -278,7 +278,7 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
bmp_rect.Intersect(m_ClipBox);
if (bmp_rect.IsEmpty()) {
FX_Free(pGlyphAndPos);
- return TRUE;
+ return true;
}
int pixel_width = FXSYS_round(bmp_rect.Width() * scale_x);
int pixel_height = FXSYS_round(bmp_rect.Height() * scale_y);
@@ -288,7 +288,7 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
CFX_DIBitmap bitmap;
if (!bitmap.Create(pixel_width, pixel_height, FXDIB_1bppMask)) {
FX_Free(pGlyphAndPos);
- return FALSE;
+ return false;
}
bitmap.Clear(0);
for (iChar = 0; iChar < nChars; iChar ++) {
@@ -308,19 +308,19 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
if (m_bpp == 8) {
if (!bitmap.Create(pixel_width, pixel_height, FXDIB_8bppMask)) {
FX_Free(pGlyphAndPos);
- return FALSE;
+ return false;
}
} else {
if (!CreateCompatibleBitmap(&bitmap, pixel_width, pixel_height)) {
FX_Free(pGlyphAndPos);
- return FALSE;
+ return false;
}
}
if (!bitmap.HasAlpha() && !bitmap.IsAlphaMask()) {
bitmap.Clear(0xFFFFFFFF);
if (!GetDIBits(&bitmap, bmp_rect.left, bmp_rect.top)) {
FX_Free(pGlyphAndPos);
- return FALSE;
+ return false;
}
} else {
bitmap.Clear(0);
@@ -352,13 +352,13 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
int nrows = pGlyph->GetHeight();
if (anti_alias == FXFT_RENDER_MODE_NORMAL) {
if (!bitmap.CompositeMask(left, top, ncols, nrows, pGlyph, fill_color,
- 0, 0, FXDIB_BLEND_NORMAL, NULL, FALSE, alpha_flag, pIccTransform)) {
+ 0, 0, FXDIB_BLEND_NORMAL, NULL, false, alpha_flag, pIccTransform)) {
FX_Free(pGlyphAndPos);
- return FALSE;
+ return false;
}
continue;
}
- FX_BOOL bBGRStripe = text_flags & FXTEXT_BGR_STRIPE;
+ bool bBGRStripe = text_flags & FXTEXT_BGR_STRIPE;
ncols /= 3;
int x_subpixel = (int)(glyph.m_fOriginX * 3) % 3;
uint8_t* src_buf = pGlyph->GetBuffer();
@@ -945,9 +945,9 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
SetDIBits(&bitmap, bmp_rect.left, bmp_rect.top);
}
FX_Free(pGlyphAndPos);
- return TRUE;
+ return true;
}
-FX_BOOL CFX_RenderDevice::DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPos,
+bool CFX_RenderDevice::DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPos,
CFX_Font* pFont, CFX_FontCache* pCache,
FX_FLOAT font_size, const CFX_AffineMatrix* pText2User,
const CFX_AffineMatrix* pUser2Device, const CFX_GraphStateData* pGraphState,
@@ -973,7 +973,7 @@ FX_BOOL CFX_RenderDevice::DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPo
matrix.Concat(*pText2User);
CFX_PathData TransformedPath(*pPath);
TransformedPath.Transform(&matrix);
- FX_BOOL bHasAlpha = FXGETFLAG_COLORTYPE(alpha_flag) ?
+ bool bHasAlpha = FXGETFLAG_COLORTYPE(alpha_flag) ?
(FXGETFLAG_ALPHA_FILL(alpha_flag) || FXGETFLAG_ALPHA_STROKE(alpha_flag)) :
(fill_color || stroke_color);
if (bHasAlpha) {
@@ -989,24 +989,24 @@ FX_BOOL CFX_RenderDevice::DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPo
}
fill_mode |= FX_FILL_TEXT_MODE;
if (!DrawPath(&TransformedPath, pUser2Device, pGraphState, fill_color, stroke_color, fill_mode, alpha_flag, pIccTransform, blend_type)) {
- return FALSE;
+ return false;
}
}
if (pClippingPath) {
pClippingPath->Append(&TransformedPath, pUser2Device);
}
}
- return TRUE;
+ return true;
}
CFX_FontCache::~CFX_FontCache()
{
- FreeCache(TRUE);
+ FreeCache(true);
}
CFX_FaceCache* CFX_FontCache::GetCachedFace(CFX_Font* pFont)
{
FXFT_Face internal_face = pFont->GetFace();
- const FX_BOOL bExternal = internal_face == nullptr;
+ const bool bExternal = internal_face == nullptr;
FXFT_Face face = bExternal ?
(FXFT_Face)pFont->GetSubstFont()->m_ExtHandle : internal_face;
CFX_FTCacheMap& map = bExternal ? m_ExtFaceMap : m_FTFaceMap;
@@ -1028,7 +1028,7 @@ CFX_FaceCache* CFX_FontCache::GetCachedFace(CFX_Font* pFont)
void CFX_FontCache::ReleaseCachedFace(CFX_Font* pFont)
{
FXFT_Face internal_face = pFont->GetFace();
- const FX_BOOL bExternal = internal_face == nullptr;
+ const bool bExternal = internal_face == nullptr;
FXFT_Face face = bExternal ?
(FXFT_Face)pFont->GetSubstFont()->m_ExtHandle : internal_face;
CFX_FTCacheMap& map = bExternal ? m_ExtFaceMap : m_FTFaceMap;
@@ -1043,7 +1043,7 @@ void CFX_FontCache::ReleaseCachedFace(CFX_Font* pFont)
}
}
-void CFX_FontCache::FreeCache(FX_BOOL bRelease)
+void CFX_FontCache::FreeCache(bool bRelease)
{
for (auto it = m_FTFaceMap.begin(); it != m_FTFaceMap.end();) {
auto curr_it = it++;
@@ -1095,7 +1095,7 @@ void CFX_FaceCache::InitPlatform()
}
#endif
CFX_GlyphBitmap* CFX_FaceCache::LookUpGlyphBitmap(CFX_Font* pFont, const CFX_AffineMatrix* pMatrix,
- CFX_ByteStringC& FaceGlyphsKey, FX_DWORD glyph_index, FX_BOOL bFontStyle,
+ CFX_ByteStringC& FaceGlyphsKey, FX_DWORD glyph_index, bool bFontStyle,
int dest_width, int anti_alias)
{
CFX_SizeGlyphCache* pSizeCache = NULL;
@@ -1114,7 +1114,7 @@ CFX_GlyphBitmap* CFX_FaceCache::LookUpGlyphBitmap(CFX_Font* pFont, const CFX_Aff
pSizeCache->m_GlyphMap.SetAt((void*)(uintptr_t)glyph_index, pGlyphBitmap);
return pGlyphBitmap;
}
-const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle, const CFX_AffineMatrix* pMatrix,
+const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_index, bool bFontStyle, const CFX_AffineMatrix* pMatrix,
int dest_width, int anti_alias, int& text_flags)
{
if (glyph_index == (FX_DWORD) - 1) {
@@ -1311,7 +1311,7 @@ static void _ContrastAdjust(uint8_t* pDataIn, uint8_t* pDataOut, int nWid, int n
}
}
}
-CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle,
+CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_index, bool bFontStyle,
const CFX_AffineMatrix* pMatrix, int dest_width, int anti_alias)
{
if (m_Face == NULL) {
@@ -1322,7 +1322,7 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_inde
ft_matrix.xy = (signed long)(pMatrix->GetC() / 64 * 65536);
ft_matrix.yx = (signed long)(pMatrix->GetB() / 64 * 65536);
ft_matrix.yy = (signed long)(pMatrix->GetD() / 64 * 65536);
- FX_BOOL bUseCJKSubFont = FALSE;
+ bool bUseCJKSubFont = false;
const CFX_SubstFont* pSubstFont = pFont->GetSubstFont();
if (pSubstFont) {
bUseCJKSubFont = pSubstFont->m_bSubstOfCJK && bFontStyle;
@@ -1422,18 +1422,18 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_inde
}
return pGlyphBitmap;
}
-FX_BOOL _OutputGlyph(void* dib, int x, int y, CFX_Font* pFont,
+bool _OutputGlyph(void* dib, int x, int y, CFX_Font* pFont,
int glyph_index, FX_ARGB argb)
{
CFX_DIBitmap* pDib = (CFX_DIBitmap*)dib;
FXFT_Face face = pFont->GetFace();
int error = FXFT_Load_Glyph(face, glyph_index, FXFT_LOAD_NO_BITMAP);
if (error) {
- return FALSE;
+ return false;
}
error = FXFT_Render_Glyph(face, FXFT_RENDER_MODE_NORMAL);
if (error) {
- return FALSE;
+ return false;
}
int bmwidth = FXFT_Get_Bitmap_Width(FXFT_Get_Glyph_Bitmap(face));
int bmheight = FXFT_Get_Bitmap_Rows(FXFT_Get_Glyph_Bitmap(face));
@@ -1451,13 +1451,13 @@ FX_BOOL _OutputGlyph(void* dib, int x, int y, CFX_Font* pFont,
FXSYS_memcpy(dest_scan, src_scan, dest_pitch);
}
pDib->CompositeMask(x + left, y - top, bmwidth, bmheight, &mask, argb, 0, 0);
- return TRUE;
+ return true;
}
-FX_BOOL OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size,
+bool OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size,
CFX_AffineMatrix* pText_matrix, unsigned short const* text, unsigned long argb)
{
if (!pFont) {
- return FALSE;
+ return false;
}
FXFT_Face face = pFont->GetFace();
FXFT_Select_Charmap(pFont->m_Face, FXFT_ENCODING_UNICODE);
@@ -1490,9 +1490,9 @@ FX_BOOL OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size,
}
if (pText_matrix)
ResetTransform(face);
- return TRUE;
+ return true;
}
-FX_BOOL OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size,
+bool OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size,
CFX_AffineMatrix* pMatrix, unsigned long glyph_index, unsigned long argb)
{
FXFT_Matrix ft_matrix;
@@ -1507,7 +1507,7 @@ FX_BOOL OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size,
ft_matrix.yy = (signed long)(font_size / 64 * 65536);
}
ScopedFontTransform scoped_transform(pFont->m_Face, &ft_matrix);
- FX_BOOL ret = _OutputGlyph(dib, x, y, pFont,
+ bool ret = _OutputGlyph(dib, x, y, pFont,
glyph_index, argb);
return ret;
}
@@ -1533,7 +1533,7 @@ const CFX_PathData* CFX_FaceCache::LoadGlyphPath(CFX_Font* pFont, FX_DWORD glyph
return pGlyphPath;
}
typedef struct {
- FX_BOOL m_bCount;
+ bool m_bCount;
int m_PointCount;
FX_PATHPOINT* m_pPoints;
int m_CurX;
@@ -1684,7 +1684,7 @@ CFX_PathData* CFX_Font::LoadGlyphPath(FX_DWORD glyph_index, int dest_width)
funcs.shift = 0;
funcs.delta = 0;
OUTLINE_PARAMS params;
- params.m_bCount = TRUE;
+ params.m_bCount = true;
params.m_PointCount = 0;
FXFT_Outline_Decompose(FXFT_Get_Glyph_Outline(m_Face), &funcs, &params);
if (params.m_PointCount == 0) {
@@ -1692,7 +1692,7 @@ CFX_PathData* CFX_Font::LoadGlyphPath(FX_DWORD glyph_index, int dest_width)
}
CFX_PathData* pPath = new CFX_PathData;
pPath->SetPointCount(params.m_PointCount);
- params.m_bCount = FALSE;
+ params.m_bCount = false;
params.m_PointCount = 0;
params.m_pPoints = pPath->GetPoints();
params.m_CurX = params.m_CurY = 0;
diff --git a/core/src/fxge/ge/text_int.h b/core/src/fxge/ge/text_int.h
index 12fac6a60a..2e861baf1b 100644
--- a/core/src/fxge/ge/text_int.h
+++ b/core/src/fxge/ge/text_int.h
@@ -32,12 +32,12 @@ public:
m_RefCount = 0;
}
~CTTFontDesc();
- FX_BOOL ReleaseFace(FXFT_Face face);
+ bool ReleaseFace(FXFT_Face face);
int m_Type;
union {
struct {
- FX_BOOL m_bItalic;
- FX_BOOL m_bBold;
+ bool m_bItalic;
+ bool m_bBold;
FXFT_Face m_pFace;
} m_SingleFace;
struct {
@@ -63,9 +63,9 @@ private:
{
return Unicode;
}
- virtual FX_BOOL IsUnicodeCompatible() const
+ virtual bool IsUnicodeCompatible() const
{
- return TRUE;
+ return true;
}
};
#define CHARSET_FLAG_ANSI 1
@@ -97,7 +97,7 @@ public:
FX_DWORD m_FileSize;
FX_DWORD m_FontOffset;
int m_Weight;
- FX_BOOL m_bItalic;
+ bool m_bItalic;
int m_PitchFamily;
CFX_ByteString m_FontTables;
};