mirror of
https://github.com/gnustep/libs-back.git
synced 2025-04-22 23:42:16 +00:00
Create the NSMutableCharacterSet to store the character ranges in.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@25448 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c821c8e5c7
commit
bc449e6b65
2 changed files with 34 additions and 27 deletions
|
@ -1,3 +1,8 @@
|
|||
2007-09-04 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source\winlib\WIN32FontInfo.m (-coveredCharacterSet): Create the
|
||||
NSMutableCharacterSet to store the character ranges in.
|
||||
|
||||
2007-09-03 Nicolas Roard <nicolas@roard.com>
|
||||
|
||||
* configure:
|
||||
|
|
|
@ -182,45 +182,47 @@ NSLog(@"No glyph for U%d", c);
|
|||
HDC hdc;
|
||||
HFONT old;
|
||||
|
||||
ms = [NSMutableCharacterSet new];
|
||||
hdc = GetDC(NULL);
|
||||
old = SelectObject(hdc, hFont);
|
||||
count = (unsigned)GetFontUnicodeRanges(hdc, 0);
|
||||
if (count > 0)
|
||||
{
|
||||
{
|
||||
gs = (GLYPHSET*)objc_malloc(count);
|
||||
if ((unsigned)GetFontUnicodeRanges(hdc, gs) == count)
|
||||
{
|
||||
numberOfGlyphs = gs->cGlyphsSupported;
|
||||
if (gs->flAccel == 1 /* GS_8BIT_INDICES */)
|
||||
{
|
||||
for (count = 0; count < gs->cRanges; count++)
|
||||
{
|
||||
NSRange range;
|
||||
|
||||
range.location = gs->ranges[count].wcLow & 0xff;
|
||||
range.length = gs->ranges[count].cGlyphs;
|
||||
[ms addCharactersInRange: range];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (count = 0; count < gs->cRanges; count++)
|
||||
{
|
||||
NSRange range;
|
||||
|
||||
range.location = gs->ranges[count].wcLow;
|
||||
range.length = gs->ranges[count].cGlyphs;
|
||||
[ms addCharactersInRange: range];
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
numberOfGlyphs = gs->cGlyphsSupported;
|
||||
if (gs->flAccel == 1 /* GS_8BIT_INDICES */)
|
||||
{
|
||||
for (count = 0; count < gs->cRanges; count++)
|
||||
{
|
||||
NSRange range;
|
||||
|
||||
range.location = gs->ranges[count].wcLow & 0xff;
|
||||
range.length = gs->ranges[count].cGlyphs;
|
||||
[ms addCharactersInRange: range];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (count = 0; count < gs->cRanges; count++)
|
||||
{
|
||||
NSRange range;
|
||||
|
||||
range.location = gs->ranges[count].wcLow;
|
||||
range.length = gs->ranges[count].cGlyphs;
|
||||
[ms addCharactersInRange: range];
|
||||
}
|
||||
}
|
||||
}
|
||||
objc_free(gs);
|
||||
}
|
||||
}
|
||||
SelectObject(hdc, old);
|
||||
ReleaseDC(NULL, hdc);
|
||||
coveredCharacterSet = [ms copy];
|
||||
RELEASE(ms);
|
||||
}
|
||||
|
||||
return coveredCharacterSet;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue