mirror of
https://github.com/gnustep/libs-back.git
synced 2025-05-31 09:21:26 +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
1b84559518
commit
c184564aa0
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>
|
2007-09-03 Nicolas Roard <nicolas@roard.com>
|
||||||
|
|
||||||
* configure:
|
* configure:
|
||||||
|
|
|
@ -182,45 +182,47 @@ NSLog(@"No glyph for U%d", c);
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
HFONT old;
|
HFONT old;
|
||||||
|
|
||||||
|
ms = [NSMutableCharacterSet new];
|
||||||
hdc = GetDC(NULL);
|
hdc = GetDC(NULL);
|
||||||
old = SelectObject(hdc, hFont);
|
old = SelectObject(hdc, hFont);
|
||||||
count = (unsigned)GetFontUnicodeRanges(hdc, 0);
|
count = (unsigned)GetFontUnicodeRanges(hdc, 0);
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
gs = (GLYPHSET*)objc_malloc(count);
|
gs = (GLYPHSET*)objc_malloc(count);
|
||||||
if ((unsigned)GetFontUnicodeRanges(hdc, gs) == count)
|
if ((unsigned)GetFontUnicodeRanges(hdc, gs) == count)
|
||||||
{
|
{
|
||||||
numberOfGlyphs = gs->cGlyphsSupported;
|
numberOfGlyphs = gs->cGlyphsSupported;
|
||||||
if (gs->flAccel == 1 /* GS_8BIT_INDICES */)
|
if (gs->flAccel == 1 /* GS_8BIT_INDICES */)
|
||||||
{
|
{
|
||||||
for (count = 0; count < gs->cRanges; count++)
|
for (count = 0; count < gs->cRanges; count++)
|
||||||
{
|
{
|
||||||
NSRange range;
|
NSRange range;
|
||||||
|
|
||||||
range.location = gs->ranges[count].wcLow & 0xff;
|
range.location = gs->ranges[count].wcLow & 0xff;
|
||||||
range.length = gs->ranges[count].cGlyphs;
|
range.length = gs->ranges[count].cGlyphs;
|
||||||
[ms addCharactersInRange: range];
|
[ms addCharactersInRange: range];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (count = 0; count < gs->cRanges; count++)
|
for (count = 0; count < gs->cRanges; count++)
|
||||||
{
|
{
|
||||||
NSRange range;
|
NSRange range;
|
||||||
|
|
||||||
range.location = gs->ranges[count].wcLow;
|
range.location = gs->ranges[count].wcLow;
|
||||||
range.length = gs->ranges[count].cGlyphs;
|
range.length = gs->ranges[count].cGlyphs;
|
||||||
[ms addCharactersInRange: range];
|
[ms addCharactersInRange: range];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
objc_free(gs);
|
objc_free(gs);
|
||||||
}
|
}
|
||||||
SelectObject(hdc, old);
|
SelectObject(hdc, old);
|
||||||
ReleaseDC(NULL, hdc);
|
ReleaseDC(NULL, hdc);
|
||||||
coveredCharacterSet = [ms copy];
|
coveredCharacterSet = [ms copy];
|
||||||
RELEASE(ms);
|
RELEASE(ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
return coveredCharacterSet;
|
return coveredCharacterSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue