// keep it
#ifdef USE_HASHMAP_FOR_FONT
r = fallbackFontMap->Add(fontNameTemp, out);
+
+ if (r == E_OBJ_ALREADY_EXIST)
+ {
+ pFallbackFont = out.get();
+ break;
+ }
+
SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
#else
fallbackFontMap->insert(_FontRsrcManager::FontMapT::value_type(fontNameTemp, out));
CHECK_NULL_PARAM(__pFontFace);
CHECK_NULL_PARAM(ppFontGlyphData);
- bool rtn = false;
- rtn = FindCache(character, __fontAttrib.size, __fontAttrib.style, ppFontGlyphData);
+ bool rtn = FindCache(character, __fontAttrib.size, __fontAttrib.style, ppFontGlyphData);
+
if (rtn)
{
return true;
pFace = FT_Face(__pFontFace);
- // is it fixed size?
if (!FT_IS_SCALABLE(pFace))
{
SysLog(NID_GRP, "[] FT_IS_SCALABLE has been failed");
FT_Matrix matrix;
FT_Vector pen = {0, 0};
- this->__SetTransMatrix(&matrix);
+ __SetTransMatrix(&matrix);
FT_Set_Transform(pFace, &matrix, &pen);
}
out.RemoveAll();
+ FT_Error error = 1;
+
+ bool isSynthetic = (__fontAttrib.style & _IFont::STYLE_BOLD) && (__fontProperty.weightClass < 500);
+
for (unsigned int i = 0; i < glyphList.GetCount(); i++)
{
const _FontGlyphList::GlyphAuxInfo& auxInfo = glyphList.GetGlyphAuxInfo(i);
FT_UInt glyph_index = auxInfo.glyphIndex;
- _IFont::GlyphBitmap image;
-
- FT_Error error = FT_Load_Glyph(pFace, glyph_index, /*FT_LOAD_RENDER*/FT_LOAD_DEFAULT/* | FT_LOAD_NO_BITMAP*/);
+ if (isSynthetic)
+ {
+ error = FT_Load_Glyph(pFace, glyph_index, FT_LOAD_DEFAULT | FT_LOAD_NO_BITMAP);
+ }
+ else
+ {
+ error = FT_Load_Glyph(pFace, glyph_index, /*FT_LOAD_RENDER*/FT_LOAD_DEFAULT/* | FT_LOAD_NO_BITMAP*/);
+ }
if (error)
{
continue;
}
+ if (isSynthetic)
+ {
+ FT_Outline_Embolden(&pFace->glyph->outline, __fontAttrib.boldWeight.__fixedPoint);
+ }
+
error = FT_Render_Glyph(pFace->glyph, FT_RENDER_MODE_NORMAL);
if (error)
continue;
}
+ _IFont::GlyphBitmap image;
+
FT_GlyphSlot pSlot = FT_GlyphSlot(pFace->glyph);
switch (pSlot->bitmap.pixel_mode)
#ifdef USE_HASHMAP_FOR_FONT
result r = __fontRsrcMap.Add(key, font);
- SysTryReturn(NID_GRP, r == E_SUCCESS, false, false, "[%s] Failed to add font into resource pool", GetErrorMessage(r));
+
+ SysTryReturn(NID_GRP, r == E_SUCCESS || r == E_OBJ_ALREADY_EXIST, false, false, "[%s] Failed to add font into resource pool", GetErrorMessage(r));
#else
__fontRsrcMap[key] = font;
#endif