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:
Fred Kiefer 2007-09-04 08:17:54 +00:00
parent c821c8e5c7
commit bc449e6b65
2 changed files with 34 additions and 27 deletions

View file

@ -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:

View file

@ -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;
}