mirror of
https://github.com/gnustep/libs-back.git
synced 2025-04-22 07:21:02 +00:00
use unicode glyph info function
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@24442 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d530f8e5ba
commit
f54377efb9
1 changed files with 13 additions and 3 deletions
|
@ -106,7 +106,7 @@ NSString *win32_font_family(NSString *fontName);
|
|||
hdc = GetDC(NULL);
|
||||
old = SelectObject(hdc, hFont);
|
||||
//GetCharWidthFloat(hdc, glyph, glyph, &w);
|
||||
GetCharABCWidthsFloat(hdc, glyph, glyph, &abc);
|
||||
GetCharABCWidthsFloatW(hdc, glyph, glyph, &abc);
|
||||
SelectObject(hdc, old);
|
||||
ReleaseDC(NULL, hdc);
|
||||
|
||||
|
@ -124,7 +124,7 @@ NSString *win32_font_family(NSString *fontName);
|
|||
|
||||
hdc = GetDC(NULL);
|
||||
old = SelectObject(hdc, hFont);
|
||||
if (GDI_ERROR != GetGlyphOutline(hdc, glyph,
|
||||
if (GDI_ERROR != GetGlyphOutlineW(hdc, glyph,
|
||||
GGO_METRICS, // || GGO_GLYPH_INDEX
|
||||
&gm, 0, NULL, NULL))
|
||||
{
|
||||
|
@ -161,8 +161,18 @@ NSString *win32_font_family(NSString *fontName);
|
|||
}
|
||||
|
||||
- (void) drawString: (NSString*)string
|
||||
onDC: (HDC)hdc at: (POINT)p
|
||||
onDC: (HDC)hdc
|
||||
at: (POINT)p
|
||||
{
|
||||
HFONT old;
|
||||
|
||||
old = SelectObject(hdc, hFont);
|
||||
TextOutW(hdc,
|
||||
p.x,
|
||||
p.y - ascender,
|
||||
(const unichar*)[string cStringUsingEncoding: NSUnicodeStringEncoding],
|
||||
[string length]);
|
||||
SelectObject(hdc, old);
|
||||
}
|
||||
|
||||
- (void) draw:(const char*)s length: (int)len
|
||||
|
|
Loading…
Reference in a new issue