Add fallback glyph when no glyph can be found for current character.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26778 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2008-07-13 09:31:00 +00:00
parent 11bede28df
commit 6b3d9536fd
2 changed files with 24 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2008-07-13 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSGlyphGenerator.m (-generateGlyphsForGlyphStorage:...):
Add fallback glyph when no glyph can be found for current character.
2008-07-13 Fred Kiefer <FredKiefer@gmx.de>
* Source/GSLayoutManager.m: Protect all access to the glyph arrays.

View file

@ -110,6 +110,7 @@ fb04 'ffl'
= (BOOL(*)(id, SEL, unichar)) [cs methodForSelector: cim_sel];
SEL gfc_sel = @selector(glyphForCharacter:);
NSGlyph (*glyphForCharacter)(id, SEL, unichar);
NSGlyph fallback = NSNullGlyph;
[[attrstr string] getCharacters: buf range: maxRange];
attributes = [attrstr attributesAtIndex: *index
@ -238,8 +239,11 @@ fb04 'ffl'
g++;
if (surr)
SEND_GLYPHS();
continue;
}
else if (ch < 0x10000)
if (ch < 0x10000)
{
unichar *decomp;
@ -257,13 +261,24 @@ fb04 'ffl'
g++;
SEND_GLYPHS();
}
continue;
}
}
else
// No glyph found add fallback
if (fallback == NSNullGlyph)
{
// On a NSNullGLyph, send all previous glyphs
SEND_GLYPHS();
// FIXME: Find a suitable fallback glyph
unichar uc = '?';
fallback = glyphForCharacter(fi, gfc_sel, uc);
}
*g = fallback;
g++;
// On a NSNullGLyph, send all previous glyphs
SEND_GLYPHS();
}
// Send all remaining glyphs