* Avoid falling back to VL Gothic if the font with a missing glyph is VL Gothic itself.
* Some cleanup and style fixes. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37419 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -177,11 +177,18 @@ GlyphLayoutEngine::LayoutGlyphs(GlyphConsumer& consumer,
|
|||||||
// Try to find a suitable glyph in another font
|
// Try to find a suitable glyph in another font
|
||||||
FontCache* cache = FontCache::Default();
|
FontCache* cache = FontCache::Default();
|
||||||
bool needsWriteLock = false;
|
bool needsWriteLock = false;
|
||||||
ServerFont f(*(gFontManager->GetStyleByIndex("VL Gothic",0)));
|
ServerFont fallbackFont(*(gFontManager->GetStyleByIndex("VL Gothic",
|
||||||
// We always try to get the glyph from VL Gothic, so we can display
|
0)));
|
||||||
// japanese character. Other scripts (indian, ...) should be handled
|
// We always try to get the glyph from VL Gothic, so we can
|
||||||
// too, perhaps with a charcode > font mapping.
|
// display japanese characters. Other scripts (indian, ...)
|
||||||
fallbackEntry = cache->FontCacheEntryFor(f);
|
// should be handled too, perhaps with a charcode > font
|
||||||
|
// mapping.
|
||||||
|
// TODO : the font should not be hardcoded, but somehow derived
|
||||||
|
// from the one that missed a glyph.
|
||||||
|
bool consumed = true;
|
||||||
|
fallbackEntry = cache->FontCacheEntryFor(fallbackFont);
|
||||||
|
if (fallbackEntry != entry)
|
||||||
|
{
|
||||||
if (!fallbackEntry || !fallbackEntry->ReadLock()) {
|
if (!fallbackEntry || !fallbackEntry->ReadLock()) {
|
||||||
cache->Recycle(fallbackEntry);
|
cache->Recycle(fallbackEntry);
|
||||||
continue;
|
continue;
|
||||||
@@ -197,9 +204,9 @@ GlyphLayoutEngine::LayoutGlyphs(GlyphConsumer& consumer,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool consumed = true;
|
|
||||||
glyph = fallbackEntry->Glyph(charCode);
|
glyph = fallbackEntry->Glyph(charCode);
|
||||||
if (glyph != NULL && !consumer.ConsumeGlyph(index, charCode, glyph, fallbackEntry, x, y)) {
|
if (glyph != NULL && !consumer.ConsumeGlyph(index, charCode,
|
||||||
|
glyph, fallbackEntry, x, y)) {
|
||||||
advanceX = 0;
|
advanceX = 0;
|
||||||
advanceY = 0;
|
advanceY = 0;
|
||||||
consumed = false;
|
consumed = false;
|
||||||
@@ -209,7 +216,7 @@ GlyphLayoutEngine::LayoutGlyphs(GlyphConsumer& consumer,
|
|||||||
fallbackEntry->WriteUnlock();
|
fallbackEntry->WriteUnlock();
|
||||||
else
|
else
|
||||||
fallbackEntry->ReadUnlock();
|
fallbackEntry->ReadUnlock();
|
||||||
|
}
|
||||||
FontCache::Default()->Recycle(fallbackEntry);
|
FontCache::Default()->Recycle(fallbackEntry);
|
||||||
|
|
||||||
if (glyph == NULL) {
|
if (glyph == NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user