Fixed header dependencies to be fully compatible with the Windows
[wine/multimedia.git] / graphics / x11drv / codepage.c
blobf93b1051cfe64a619c51b393b71d15deb1f7eca2
1 /*
2 * X11 codepage handling
4 * Copyright 2000 Hidenori Takeshima <hidenori@a2.ctktv.ne.jp>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include "config.h"
23 #include "ts_xlib.h"
25 #include <math.h>
26 #include <stdarg.h>
28 #include "windef.h"
29 #include "winbase.h"
30 #include "winnls.h"
31 #include "x11font.h"
32 #include "wine/debug.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(text);
36 /***********************************************************************
37 * IsLegalDBCSChar for cp932/936/949/950/euc
39 static inline
40 int IsLegalDBCSChar_cp932( BYTE lead, BYTE trail )
42 return ( ( ( lead >= (BYTE)0x81 && lead <= (BYTE)0x9f ) ||
43 ( lead >= (BYTE)0xe0 && lead <= (BYTE)0xfc ) ) &&
44 ( ( trail >= (BYTE)0x40 && trail <= (BYTE)0x7e ) ||
45 ( trail >= (BYTE)0x80 && trail <= (BYTE)0xfc ) ) );
48 static inline
49 int IsLegalDBCSChar_cp936( BYTE lead, BYTE trail )
51 return ( ( lead >= (BYTE)0x81 && lead <= (BYTE)0xfe ) &&
52 ( trail >= (BYTE)0x40 && trail <= (BYTE)0xfe ) );
55 static inline
56 int IsLegalDBCSChar_cp949( BYTE lead, BYTE trail )
58 return ( ( lead >= (BYTE)0x81 && lead <= (BYTE)0xfe ) &&
59 ( trail >= (BYTE)0x41 && trail <= (BYTE)0xfe ) );
62 static inline
63 int IsLegalDBCSChar_cp950( BYTE lead, BYTE trail )
65 return ( ( lead >= (BYTE)0x81 && lead <= (BYTE)0xfe ) &&
66 ( ( trail >= (BYTE)0x40 && trail <= (BYTE)0x7e ) ||
67 ( trail >= (BYTE)0xa1 && trail <= (BYTE)0xfe ) ) );
70 static inline
71 int IsLegalDBCSChar_euc( BYTE lead, BYTE trail )
73 return ( ( lead >= (BYTE)0xa1 && lead <= (BYTE)0xfe ) &&
74 ( trail >= (BYTE)0xa1 && trail <= (BYTE)0xfe ) );
78 /***********************************************************************
79 * DBCSCharToXChar2b for cp932/euc
82 static inline
83 void DBCSCharToXChar2b_cp932( XChar2b* pch, BYTE lead, BYTE trail )
85 unsigned int high, low;
87 high = (unsigned int)lead;
88 low = (unsigned int)trail;
90 if ( high <= 0x9f )
91 high = (high<<1) - 0xe0;
92 else
93 high = (high<<1) - 0x160;
94 if ( low < 0x9f )
96 high --;
97 if ( low < 0x7f )
98 low -= 0x1f;
99 else
100 low -= 0x20;
102 else
104 low -= 0x7e;
107 pch->byte1 = (unsigned char)high;
108 pch->byte2 = (unsigned char)low;
111 static inline
112 void DBCSCharToXChar2b_euc( XChar2b* pch, BYTE lead, BYTE trail )
114 pch->byte1 = lead & (BYTE)0x7f;
115 pch->byte2 = trail & (BYTE)0x7f;
121 static WORD X11DRV_enum_subfont_charset_normal( UINT index )
123 return DEFAULT_CHARSET;
126 static WORD X11DRV_enum_subfont_charset_cp932( UINT index )
128 switch ( index )
130 case 0: return X11FONT_JISX0201_CHARSET;
131 case 1: return X11FONT_JISX0212_CHARSET;
134 return DEFAULT_CHARSET;
137 static WORD X11DRV_enum_subfont_charset_cp936( UINT index )
139 switch ( index )
141 case 0: return ANSI_CHARSET;
144 return DEFAULT_CHARSET;
147 static WORD X11DRV_enum_subfont_charset_cp949( UINT index )
149 switch ( index )
151 case 0: return ANSI_CHARSET;
154 return DEFAULT_CHARSET;
157 static WORD X11DRV_enum_subfont_charset_cp950( UINT index )
159 switch ( index )
161 case 0: return ANSI_CHARSET;
164 return DEFAULT_CHARSET;
168 static XChar2b* X11DRV_unicode_to_char2b_sbcs( fontObject* pfo,
169 LPCWSTR lpwstr, UINT count )
171 XChar2b *str2b;
172 UINT i;
173 BYTE *str;
174 UINT codepage = pfo->fi->codepage;
175 char ch = pfo->fs->default_char;
177 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
178 return NULL;
179 if (!(str = HeapAlloc( GetProcessHeap(), 0, count )))
181 HeapFree( GetProcessHeap(), 0, str2b );
182 return NULL;
185 WideCharToMultiByte( codepage, 0, lpwstr, count, str, count, &ch, NULL );
187 for (i = 0; i < count; i++)
189 str2b[i].byte1 = 0;
190 str2b[i].byte2 = str[i];
192 HeapFree( GetProcessHeap(), 0, str );
194 return str2b;
197 static XChar2b* X11DRV_unicode_to_char2b_unicode( fontObject* pfo,
198 LPCWSTR lpwstr, UINT count )
200 XChar2b *str2b;
201 UINT i;
203 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
204 return NULL;
206 for (i = 0; i < count; i++)
208 str2b[i].byte1 = lpwstr[i] >> 8;
209 str2b[i].byte2 = lpwstr[i] & 0xff;
212 return str2b;
215 /* FIXME: handle jisx0212.1990... */
216 static XChar2b* X11DRV_unicode_to_char2b_cp932( fontObject* pfo,
217 LPCWSTR lpwstr, UINT count )
219 XChar2b *str2b;
220 XChar2b *str2b_dst;
221 BYTE *str;
222 BYTE *str_src;
223 UINT i;
224 char ch = pfo->fs->default_char;
226 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
227 return NULL;
228 if (!(str = HeapAlloc( GetProcessHeap(), 0, count*2 )))
230 HeapFree( GetProcessHeap(), 0, str2b );
231 return NULL;
234 /* handle jisx0212.1990... */
235 WideCharToMultiByte( 932, 0, lpwstr, count, str, count*2, &ch, NULL );
237 str_src = str;
238 str2b_dst = str2b;
239 for (i = 0; i < count; i++, str_src++, str2b_dst++)
241 if ( IsLegalDBCSChar_cp932( *str_src, *(str_src+1) ) )
243 DBCSCharToXChar2b_cp932( str2b_dst, *str_src, *(str_src+1) );
244 str_src++;
246 else
248 str2b_dst->byte1 = 0;
249 str2b_dst->byte2 = *str_src;
253 HeapFree( GetProcessHeap(), 0, str );
255 return str2b;
259 static XChar2b* X11DRV_unicode_to_char2b_cp936( fontObject* pfo,
260 LPCWSTR lpwstr, UINT count )
262 XChar2b *str2b;
263 XChar2b *str2b_dst;
264 BYTE *str;
265 BYTE *str_src;
266 UINT i;
267 char ch = pfo->fs->default_char;
269 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
270 return NULL;
271 if (!(str = HeapAlloc( GetProcessHeap(), 0, count*2 )))
273 HeapFree( GetProcessHeap(), 0, str2b );
274 return NULL;
276 WideCharToMultiByte( 936, 0, lpwstr, count, str, count*2, &ch, NULL );
278 str_src = str;
279 str2b_dst = str2b;
280 for (i = 0; i < count; i++, str_src++, str2b_dst++)
282 if ( IsLegalDBCSChar_cp936( *str_src, *(str_src+1) ) )
284 str2b_dst->byte1 = *str_src;
285 str2b_dst->byte2 = *(str_src+1);
286 str_src++;
288 else
290 str2b_dst->byte1 = 0;
291 str2b_dst->byte2 = *str_src;
295 HeapFree( GetProcessHeap(), 0, str );
297 return str2b;
300 static XChar2b* X11DRV_unicode_to_char2b_cp949( fontObject* pfo,
301 LPCWSTR lpwstr, UINT count )
303 XChar2b *str2b;
304 XChar2b *str2b_dst;
305 BYTE *str;
306 BYTE *str_src;
307 UINT i;
308 char ch = pfo->fs->default_char;
310 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
311 return NULL;
312 if (!(str = HeapAlloc( GetProcessHeap(), 0, count*2 )))
314 HeapFree( GetProcessHeap(), 0, str2b );
315 return NULL;
317 WideCharToMultiByte( 949, 0, lpwstr, count, str, count*2, &ch, NULL );
319 str_src = str;
320 str2b_dst = str2b;
321 for (i = 0; i < count; i++, str_src++, str2b_dst++)
323 if ( IsLegalDBCSChar_cp949( *str_src, *(str_src+1) ) )
325 str2b_dst->byte1 = *str_src;
326 str2b_dst->byte2 = *(str_src+1);
327 str_src++;
329 else
331 str2b_dst->byte1 = 0;
332 str2b_dst->byte2 = *str_src;
336 HeapFree( GetProcessHeap(), 0, str );
338 return str2b;
342 static XChar2b* X11DRV_unicode_to_char2b_cp950( fontObject* pfo,
343 LPCWSTR lpwstr, UINT count )
345 XChar2b *str2b;
346 XChar2b *str2b_dst;
347 BYTE *str;
348 BYTE *str_src;
349 UINT i;
350 char ch = pfo->fs->default_char;
352 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
353 return NULL;
354 if (!(str = HeapAlloc( GetProcessHeap(), 0, count*2 )))
356 HeapFree( GetProcessHeap(), 0, str2b );
357 return NULL;
359 WideCharToMultiByte( 950, 0, lpwstr, count, str, count*2, &ch, NULL );
361 str_src = str;
362 str2b_dst = str2b;
363 for (i = 0; i < count; i++, str_src++, str2b_dst++)
365 if ( IsLegalDBCSChar_cp950( *str_src, *(str_src+1) ) )
367 str2b_dst->byte1 = *str_src;
368 str2b_dst->byte2 = *(str_src+1);
369 str_src++;
371 else
373 str2b_dst->byte1 = 0;
374 str2b_dst->byte2 = *str_src;
378 HeapFree( GetProcessHeap(), 0, str );
380 return str2b;
383 static XChar2b* X11DRV_unicode_to_char2b_symbol( fontObject* pfo,
384 LPCWSTR lpwstr, UINT count )
386 XChar2b *str2b;
387 UINT i;
388 char ch = pfo->fs->default_char;
390 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
391 return NULL;
393 for (i = 0; i < count; i++)
395 str2b[i].byte1 = 0;
396 if(lpwstr[i] >= 0xf000 && lpwstr[i] < 0xf100)
397 str2b[i].byte2 = lpwstr[i] - 0xf000;
398 else if(lpwstr[i] < 0x100)
399 str2b[i].byte2 = lpwstr[i];
400 else
401 str2b[i].byte2 = ch;
404 return str2b;
408 static void X11DRV_DrawString_normal( fontObject* pfo, Display* pdisp,
409 Drawable d, GC gc, int x, int y,
410 XChar2b* pstr, int count )
412 TSXDrawString16( pdisp, d, gc, x, y, pstr, count );
415 static int X11DRV_TextWidth_normal( fontObject* pfo, XChar2b* pstr, int count )
417 return TSXTextWidth16( pfo->fs, pstr, count );
420 static void X11DRV_DrawText_normal( fontObject* pfo, Display* pdisp, Drawable d,
421 GC gc, int x, int y, XTextItem16* pitems,
422 int count )
424 TSXDrawText16( pdisp, d, gc, x, y, pitems, count );
427 static void X11DRV_TextExtents_normal( fontObject* pfo, XChar2b* pstr, int count,
428 int* pdir, int* pascent, int* pdescent,
429 int* pwidth )
431 XCharStruct info;
433 TSXTextExtents16( pfo->fs, pstr, count, pdir, pascent, pdescent, &info );
434 *pwidth = info.width;
437 static void X11DRV_GetTextMetricsW_normal( fontObject* pfo, LPTEXTMETRICW pTM )
439 LPIFONTINFO16 pdf = &pfo->fi->df;
441 if( ! pfo->lpX11Trans ) {
442 pTM->tmAscent = pfo->fs->ascent;
443 pTM->tmDescent = pfo->fs->descent;
444 } else {
445 pTM->tmAscent = pfo->lpX11Trans->ascent;
446 pTM->tmDescent = pfo->lpX11Trans->descent;
449 pTM->tmAscent *= pfo->rescale;
450 pTM->tmDescent *= pfo->rescale;
452 pTM->tmHeight = pTM->tmAscent + pTM->tmDescent;
454 pTM->tmAveCharWidth = pfo->foAvgCharWidth * pfo->rescale;
455 pTM->tmMaxCharWidth = pfo->foMaxCharWidth * pfo->rescale;
457 pTM->tmInternalLeading = pfo->foInternalLeading * pfo->rescale;
458 pTM->tmExternalLeading = pdf->dfExternalLeading * pfo->rescale;
460 pTM->tmStruckOut = (pfo->fo_flags & FO_SYNTH_STRIKEOUT )
461 ? 1 : pdf->dfStrikeOut;
462 pTM->tmUnderlined = (pfo->fo_flags & FO_SYNTH_UNDERLINE )
463 ? 1 : pdf->dfUnderline;
465 pTM->tmOverhang = 0;
466 if( pfo->fo_flags & FO_SYNTH_ITALIC )
468 pTM->tmOverhang += pTM->tmHeight/3;
469 pTM->tmItalic = 1;
470 } else
471 pTM->tmItalic = pdf->dfItalic;
473 pTM->tmWeight = pdf->dfWeight;
474 if( pfo->fo_flags & FO_SYNTH_BOLD )
476 pTM->tmOverhang++;
477 pTM->tmWeight += 100;
480 pTM->tmFirstChar = pdf->dfFirstChar;
481 pTM->tmLastChar = pdf->dfLastChar;
482 pTM->tmDefaultChar = pdf->dfDefaultChar;
483 pTM->tmBreakChar = pdf->dfBreakChar;
485 pTM->tmCharSet = pdf->dfCharSet;
486 pTM->tmPitchAndFamily = pdf->dfPitchAndFamily;
488 pTM->tmDigitizedAspectX = pdf->dfHorizRes;
489 pTM->tmDigitizedAspectY = pdf->dfVertRes;
494 static
495 void X11DRV_DrawString_dbcs( fontObject* pfo, Display* pdisp,
496 Drawable d, GC gc, int x, int y,
497 XChar2b* pstr, int count )
499 XTextItem16 item;
501 item.chars = pstr;
502 item.delta = 0;
503 item.nchars = count;
504 item.font = None;
505 X11DRV_cptable[pfo->fi->cptable].pDrawText(
506 pfo, pdisp, d, gc, x, y, &item, 1 );
509 static
510 int X11DRV_TextWidth_dbcs_2fonts( fontObject* pfo, XChar2b* pstr, int count )
512 int i;
513 int width;
514 int curfont;
515 fontObject* pfos[X11FONT_REFOBJS_MAX+1];
517 pfos[0] = XFONT_GetFontObject( pfo->prefobjs[0] );
518 pfos[1] = pfo;
519 if ( pfos[0] == NULL ) pfos[0] = pfo;
521 width = 0;
522 for ( i = 0; i < count; i++ )
524 curfont = ( pstr->byte1 != 0 ) ? 1 : 0;
525 width += TSXTextWidth16( pfos[curfont]->fs, pstr, 1 );
526 pstr ++;
529 return width;
532 static
533 void X11DRV_DrawText_dbcs_2fonts( fontObject* pfo, Display* pdisp, Drawable d,
534 GC gc, int x, int y, XTextItem16* pitems,
535 int count )
537 int i, nitems, prevfont = -1, curfont;
538 XChar2b* pstr;
539 XTextItem16* ptibuf;
540 XTextItem16* pti;
541 fontObject* pfos[X11FONT_REFOBJS_MAX+1];
543 pfos[0] = XFONT_GetFontObject( pfo->prefobjs[0] );
544 pfos[1] = pfo;
545 if ( pfos[0] == NULL ) pfos[0] = pfo;
547 nitems = 0;
548 for ( i = 0; i < count; i++ )
549 nitems += pitems->nchars;
550 ptibuf = HeapAlloc( GetProcessHeap(), 0, sizeof(XTextItem16) * nitems );
551 if ( ptibuf == NULL )
552 return; /* out of memory */
554 pti = ptibuf;
555 while ( count-- > 0 )
557 pti->chars = pstr = pitems->chars;
558 pti->delta = pitems->delta;
559 pti->font = None;
560 for ( i = 0; i < pitems->nchars; i++, pstr++ )
562 curfont = ( pstr->byte1 != 0 ) ? 1 : 0;
563 if ( curfont != prevfont )
565 if ( pstr != pti->chars )
567 pti->nchars = pstr - pti->chars;
568 pti ++;
569 pti->chars = pstr;
570 pti->delta = 0;
572 pti->font = pfos[curfont]->fs->fid;
573 prevfont = curfont;
576 pti->nchars = pstr - pti->chars;
577 pitems ++; pti ++;
579 TSXDrawText16( pdisp, d, gc, x, y, ptibuf, pti - ptibuf );
580 HeapFree( GetProcessHeap(), 0, ptibuf );
583 static
584 void X11DRV_TextExtents_dbcs_2fonts( fontObject* pfo, XChar2b* pstr, int count,
585 int* pdir, int* pascent, int* pdescent,
586 int* pwidth )
588 XCharStruct info;
589 int ascent, descent, width;
590 int i;
591 int curfont;
592 fontObject* pfos[X11FONT_REFOBJS_MAX+1];
594 pfos[0] = XFONT_GetFontObject( pfo->prefobjs[0] );
595 pfos[1] = pfo;
596 if ( pfos[0] == NULL ) pfos[0] = pfo;
598 width = 0;
599 *pascent = 0;
600 *pdescent = 0;
601 for ( i = 0; i < count; i++ )
603 curfont = ( pstr->byte1 != 0 ) ? 1 : 0;
604 TSXTextExtents16( pfos[curfont]->fs, pstr, 1, pdir,
605 &ascent, &descent, &info );
606 if ( *pascent < ascent ) *pascent = ascent;
607 if ( *pdescent < descent ) *pdescent = descent;
608 width += info.width;
610 pstr ++;
613 *pwidth = width;
616 static void X11DRV_GetTextMetricsW_cp932( fontObject* pfo, LPTEXTMETRICW pTM )
618 fontObject* pfo_ansi = XFONT_GetFontObject( pfo->prefobjs[0] );
619 LPIFONTINFO16 pdf = &pfo->fi->df;
620 LPIFONTINFO16 pdf_ansi;
622 pdf_ansi = ( pfo_ansi != NULL ) ? (&pfo_ansi->fi->df) : pdf;
624 if( ! pfo->lpX11Trans ) {
625 pTM->tmAscent = pfo->fs->ascent;
626 pTM->tmDescent = pfo->fs->descent;
627 } else {
628 pTM->tmAscent = pfo->lpX11Trans->ascent;
629 pTM->tmDescent = pfo->lpX11Trans->descent;
632 pTM->tmAscent *= pfo->rescale;
633 pTM->tmDescent *= pfo->rescale;
635 pTM->tmHeight = pTM->tmAscent + pTM->tmDescent;
637 if ( pfo_ansi != NULL )
639 pTM->tmAveCharWidth = floor((pfo_ansi->foAvgCharWidth * 2.0 + pfo->foAvgCharWidth) / 3.0 * pfo->rescale + 0.5);
640 pTM->tmMaxCharWidth = max(pfo_ansi->foMaxCharWidth, pfo->foMaxCharWidth) * pfo->rescale;
642 else
644 pTM->tmAveCharWidth = floor((pfo->foAvgCharWidth * pfo->rescale + 1.0) / 2.0);
645 pTM->tmMaxCharWidth = pfo->foMaxCharWidth * pfo->rescale;
648 pTM->tmInternalLeading = pfo->foInternalLeading * pfo->rescale;
649 pTM->tmExternalLeading = pdf->dfExternalLeading * pfo->rescale;
651 pTM->tmStruckOut = (pfo->fo_flags & FO_SYNTH_STRIKEOUT )
652 ? 1 : pdf->dfStrikeOut;
653 pTM->tmUnderlined = (pfo->fo_flags & FO_SYNTH_UNDERLINE )
654 ? 1 : pdf->dfUnderline;
656 pTM->tmOverhang = 0;
657 if( pfo->fo_flags & FO_SYNTH_ITALIC )
659 pTM->tmOverhang += pTM->tmHeight/3;
660 pTM->tmItalic = 1;
661 } else
662 pTM->tmItalic = pdf->dfItalic;
664 pTM->tmWeight = pdf->dfWeight;
665 if( pfo->fo_flags & FO_SYNTH_BOLD )
667 pTM->tmOverhang++;
668 pTM->tmWeight += 100;
671 pTM->tmFirstChar = pdf_ansi->dfFirstChar;
672 pTM->tmLastChar = pdf_ansi->dfLastChar;
673 pTM->tmDefaultChar = pdf_ansi->dfDefaultChar;
674 pTM->tmBreakChar = pdf_ansi->dfBreakChar;
676 pTM->tmCharSet = pdf->dfCharSet;
677 pTM->tmPitchAndFamily = pdf->dfPitchAndFamily;
679 pTM->tmDigitizedAspectX = pdf->dfHorizRes;
680 pTM->tmDigitizedAspectY = pdf->dfVertRes;
687 const X11DRV_CP X11DRV_cptable[X11DRV_CPTABLE_COUNT] =
689 { /* SBCS */
690 X11DRV_enum_subfont_charset_normal,
691 X11DRV_unicode_to_char2b_sbcs,
692 X11DRV_DrawString_normal,
693 X11DRV_TextWidth_normal,
694 X11DRV_DrawText_normal,
695 X11DRV_TextExtents_normal,
696 X11DRV_GetTextMetricsW_normal,
698 { /* UNICODE */
699 X11DRV_enum_subfont_charset_normal,
700 X11DRV_unicode_to_char2b_unicode,
701 X11DRV_DrawString_normal,
702 X11DRV_TextWidth_normal,
703 X11DRV_DrawText_normal,
704 X11DRV_TextExtents_normal,
705 X11DRV_GetTextMetricsW_normal,
707 { /* CP932 */
708 X11DRV_enum_subfont_charset_cp932,
709 X11DRV_unicode_to_char2b_cp932,
710 X11DRV_DrawString_dbcs,
711 X11DRV_TextWidth_dbcs_2fonts,
712 X11DRV_DrawText_dbcs_2fonts,
713 X11DRV_TextExtents_dbcs_2fonts,
714 X11DRV_GetTextMetricsW_cp932,
716 { /* CP936 */
717 X11DRV_enum_subfont_charset_cp936,
718 X11DRV_unicode_to_char2b_cp936,
719 X11DRV_DrawString_dbcs,
720 X11DRV_TextWidth_dbcs_2fonts,
721 X11DRV_DrawText_dbcs_2fonts,
722 X11DRV_TextExtents_dbcs_2fonts,
723 X11DRV_GetTextMetricsW_normal, /* FIXME */
725 { /* CP949 */
726 X11DRV_enum_subfont_charset_cp949,
727 X11DRV_unicode_to_char2b_cp949,
728 X11DRV_DrawString_dbcs,
729 X11DRV_TextWidth_dbcs_2fonts,
730 X11DRV_DrawText_dbcs_2fonts,
731 X11DRV_TextExtents_dbcs_2fonts,
732 X11DRV_GetTextMetricsW_normal, /* FIXME */
734 { /* CP950 */
735 X11DRV_enum_subfont_charset_cp950,
736 X11DRV_unicode_to_char2b_cp950,
737 X11DRV_DrawString_dbcs,
738 X11DRV_TextWidth_dbcs_2fonts,
739 X11DRV_DrawText_dbcs_2fonts,
740 X11DRV_TextExtents_dbcs_2fonts,
741 X11DRV_GetTextMetricsW_cp932,
743 { /* SYMBOL */
744 X11DRV_enum_subfont_charset_normal,
745 X11DRV_unicode_to_char2b_symbol,
746 X11DRV_DrawString_normal,
747 X11DRV_TextWidth_normal,
748 X11DRV_DrawText_normal,
749 X11DRV_TextExtents_normal,
750 X11DRV_GetTextMetricsW_normal,