From ff33fd939f0461ee5ebde809f5e6f62b883e8926 Mon Sep 17 00:00:00 2001 From: Richard Frith-Macdonald Date: Sat, 11 May 2002 07:11:54 +0000 Subject: [PATCH] Avoid old non-standard API git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@13629 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/xlib/XGFont.m | 17 ++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index e7ff771..08391be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-05-11 Richard Frith-Macdonald + + * Source/Source/xlib/XGFont.m: ([-xCharStructForGlyph:]) use newer + GSGFromUnicode() API. + 2002-05-09 Adam Fedor * Headers/gsc/GSGState.h: Add color and text ivars. diff --git a/Source/xlib/XGFont.m b/Source/xlib/XGFont.m index 31378b0..698dad1 100644 --- a/Source/xlib/XGFont.m +++ b/Source/xlib/XGFont.m @@ -348,15 +348,22 @@ static BOOL XGInitAtoms(Display *dpy) // glyph is an unicode char value // if the font has non-standard encoding we need to remap it. - if ((mostCompatibleStringEncoding != NSASCIIStringEncoding) && - (mostCompatibleStringEncoding != NSISOLatin1StringEncoding) && - (mostCompatibleStringEncoding != NSUnicodeStringEncoding)) + if ((mostCompatibleStringEncoding != NSASCIIStringEncoding) + && (mostCompatibleStringEncoding != NSISOLatin1StringEncoding) + && (mostCompatibleStringEncoding != NSUnicodeStringEncoding)) { // FIXME: This only works for 8-Bit characters - index = encode_unitochar(glyph, mostCompatibleStringEncoding); + unsigned int size = 1; + unsigned char c = 0; + unsigned char *dst = &c; + + GSFromUnicode(&dst, &size, &glyph, 1, enc, 0, 0); + index = c } else - index = glyph; + { + index = glyph; + } if (min1 == 0 && max1 == 0) {