midimap: Win64 printf format warning fixes.
[wine/wine-gecko.git] / dlls / winex11.drv / codepage.c
blob7611735b5e5715680e3ab48a28fa68dca1a41127
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "config.h"
23 #include <math.h>
24 #include <stdarg.h>
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winnls.h"
29 #include "x11font.h"
31 /***********************************************************************
32 * IsLegalDBCSChar for cp932/936/949/950/euc
34 static inline
35 int IsLegalDBCSChar_cp932( BYTE lead, BYTE trail )
37 return ( ( ( lead >= (BYTE)0x81 && lead <= (BYTE)0x9f ) ||
38 ( lead >= (BYTE)0xe0 && lead <= (BYTE)0xfc ) ) &&
39 ( ( trail >= (BYTE)0x40 && trail <= (BYTE)0x7e ) ||
40 ( trail >= (BYTE)0x80 && trail <= (BYTE)0xfc ) ) );
43 static inline
44 int IsLegalDBCSChar_cp936( BYTE lead, BYTE trail )
46 return ( ( lead >= (BYTE)0x81 && lead <= (BYTE)0xfe ) &&
47 ( trail >= (BYTE)0x40 && trail <= (BYTE)0xfe ) );
50 static inline
51 int IsLegalDBCSChar_cp949( BYTE lead, BYTE trail )
53 return ( ( lead >= (BYTE)0x81 && lead <= (BYTE)0xfe ) &&
54 ( trail >= (BYTE)0x41 && trail <= (BYTE)0xfe ) );
57 static inline
58 int IsLegalDBCSChar_cp950( BYTE lead, BYTE trail )
60 return ( ( lead >= (BYTE)0x81 && lead <= (BYTE)0xfe ) &&
61 ( ( trail >= (BYTE)0x40 && trail <= (BYTE)0x7e ) ||
62 ( trail >= (BYTE)0xa1 && trail <= (BYTE)0xfe ) ) );
65 static inline
66 int IsLegalDBCSChar_euc( BYTE lead, BYTE trail )
68 return ( ( lead >= (BYTE)0xa1 && lead <= (BYTE)0xfe ) &&
69 ( trail >= (BYTE)0xa1 && trail <= (BYTE)0xfe ) );
73 /***********************************************************************
74 * DBCSCharToXChar2b for cp932/euc
77 static inline
78 void DBCSCharToXChar2b_cp932( XChar2b* pch, BYTE lead, BYTE trail )
80 unsigned int high, low;
82 high = (unsigned int)lead;
83 low = (unsigned int)trail;
85 if ( high <= 0x9f )
86 high = (high<<1) - 0xe0;
87 else
88 high = (high<<1) - 0x160;
89 if ( low < 0x9f )
91 high --;
92 if ( low < 0x7f )
93 low -= 0x1f;
94 else
95 low -= 0x20;
97 else
99 low -= 0x7e;
102 pch->byte1 = (unsigned char)high;
103 pch->byte2 = (unsigned char)low;
106 static inline
107 void DBCSCharToXChar2b_euc( XChar2b* pch, BYTE lead, BYTE trail )
109 pch->byte1 = lead & (BYTE)0x7f;
110 pch->byte2 = trail & (BYTE)0x7f;
116 static WORD X11DRV_enum_subfont_charset_normal( UINT index )
118 return DEFAULT_CHARSET;
121 static WORD X11DRV_enum_subfont_charset_cp932( UINT index )
123 switch ( index )
125 case 0: return X11FONT_JISX0201_CHARSET;
126 case 1: return X11FONT_JISX0212_CHARSET;
129 return DEFAULT_CHARSET;
132 static WORD X11DRV_enum_subfont_charset_cp936( UINT index )
134 switch ( index )
136 case 0: return ANSI_CHARSET;
139 return DEFAULT_CHARSET;
142 static WORD X11DRV_enum_subfont_charset_cp949( UINT index )
144 switch ( index )
146 case 0: return ANSI_CHARSET;
149 return DEFAULT_CHARSET;
152 static WORD X11DRV_enum_subfont_charset_cp950( UINT index )
154 switch ( index )
156 case 0: return ANSI_CHARSET;
159 return DEFAULT_CHARSET;
163 static XChar2b* X11DRV_unicode_to_char2b_sbcs( fontObject* pfo,
164 LPCWSTR lpwstr, UINT count )
166 XChar2b *str2b;
167 UINT i;
168 char *str;
169 UINT codepage = pfo->fi->codepage;
170 char ch = pfo->fs->default_char;
172 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
173 return NULL;
174 if (!(str = HeapAlloc( GetProcessHeap(), 0, count )))
176 HeapFree( GetProcessHeap(), 0, str2b );
177 return NULL;
180 WideCharToMultiByte( codepage, 0, lpwstr, count, str, count, &ch, NULL );
182 for (i = 0; i < count; i++)
184 str2b[i].byte1 = 0;
185 str2b[i].byte2 = str[i];
187 HeapFree( GetProcessHeap(), 0, str );
189 return str2b;
192 static XChar2b* X11DRV_unicode_to_char2b_unicode( fontObject* pfo,
193 LPCWSTR lpwstr, UINT count )
195 XChar2b *str2b;
196 UINT i;
198 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
199 return NULL;
201 for (i = 0; i < count; i++)
203 str2b[i].byte1 = lpwstr[i] >> 8;
204 str2b[i].byte2 = lpwstr[i] & 0xff;
207 return str2b;
210 /* FIXME: handle jisx0212.1990... */
211 static XChar2b* X11DRV_unicode_to_char2b_cp932( fontObject* pfo,
212 LPCWSTR lpwstr, UINT count )
214 XChar2b *str2b;
215 XChar2b *str2b_dst;
216 char *str;
217 BYTE *str_src;
218 UINT i;
219 char ch = pfo->fs->default_char;
221 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
222 return NULL;
223 if (!(str = HeapAlloc( GetProcessHeap(), 0, count*2 )))
225 HeapFree( GetProcessHeap(), 0, str2b );
226 return NULL;
229 /* handle jisx0212.1990... */
230 WideCharToMultiByte( 932, 0, lpwstr, count, str, count*2, &ch, NULL );
232 str_src = (BYTE*) str;
233 str2b_dst = str2b;
234 for (i = 0; i < count; i++, str_src++, str2b_dst++)
236 if ( IsLegalDBCSChar_cp932( *str_src, *(str_src+1) ) )
238 DBCSCharToXChar2b_cp932( str2b_dst, *str_src, *(str_src+1) );
239 str_src++;
241 else
243 str2b_dst->byte1 = 0;
244 str2b_dst->byte2 = *str_src;
248 HeapFree( GetProcessHeap(), 0, str );
250 return str2b;
254 static XChar2b* X11DRV_unicode_to_char2b_cp936( fontObject* pfo,
255 LPCWSTR lpwstr, UINT count )
257 XChar2b *str2b;
258 XChar2b *str2b_dst;
259 char *str;
260 BYTE *str_src;
261 UINT i;
262 char ch = pfo->fs->default_char;
264 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
265 return NULL;
266 if (!(str = HeapAlloc( GetProcessHeap(), 0, count*2 )))
268 HeapFree( GetProcessHeap(), 0, str2b );
269 return NULL;
271 WideCharToMultiByte( 936, 0, lpwstr, count, str, count*2, &ch, NULL );
273 str_src = (BYTE*) str;
274 str2b_dst = str2b;
275 for (i = 0; i < count; i++, str_src++, str2b_dst++)
277 if ( IsLegalDBCSChar_cp936( *str_src, *(str_src+1) ) )
279 str2b_dst->byte1 = *str_src;
280 str2b_dst->byte2 = *(str_src+1);
281 str_src++;
283 else
285 str2b_dst->byte1 = 0;
286 str2b_dst->byte2 = *str_src;
290 HeapFree( GetProcessHeap(), 0, str );
292 return str2b;
295 static XChar2b* X11DRV_unicode_to_char2b_cp949( fontObject* pfo,
296 LPCWSTR lpwstr, UINT count )
298 XChar2b *str2b;
299 XChar2b *str2b_dst;
300 char *str;
301 BYTE *str_src;
302 UINT i;
303 char ch = pfo->fs->default_char;
305 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
306 return NULL;
307 if (!(str = HeapAlloc( GetProcessHeap(), 0, count*2 )))
309 HeapFree( GetProcessHeap(), 0, str2b );
310 return NULL;
312 WideCharToMultiByte( 949, 0, lpwstr, count, str, count*2, &ch, NULL );
314 str_src = (BYTE*) str;
315 str2b_dst = str2b;
316 for (i = 0; i < count; i++, str_src++, str2b_dst++)
318 if ( IsLegalDBCSChar_cp949( *str_src, *(str_src+1) ) )
320 str2b_dst->byte1 = *str_src;
321 str2b_dst->byte2 = *(str_src+1);
322 str_src++;
324 else
326 str2b_dst->byte1 = 0;
327 str2b_dst->byte2 = *str_src;
331 HeapFree( GetProcessHeap(), 0, str );
333 return str2b;
337 static XChar2b* X11DRV_unicode_to_char2b_cp950( fontObject* pfo,
338 LPCWSTR lpwstr, UINT count )
340 XChar2b *str2b;
341 XChar2b *str2b_dst;
342 char *str;
343 BYTE *str_src;
344 UINT i;
345 char ch = pfo->fs->default_char;
347 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
348 return NULL;
349 if (!(str = HeapAlloc( GetProcessHeap(), 0, count*2 )))
351 HeapFree( GetProcessHeap(), 0, str2b );
352 return NULL;
354 WideCharToMultiByte( 950, 0, lpwstr, count, str, count*2, &ch, NULL );
356 str_src = (BYTE*) str;
357 str2b_dst = str2b;
358 for (i = 0; i < count; i++, str_src++, str2b_dst++)
360 if ( IsLegalDBCSChar_cp950( *str_src, *(str_src+1) ) )
362 str2b_dst->byte1 = *str_src;
363 str2b_dst->byte2 = *(str_src+1);
364 str_src++;
366 else
368 str2b_dst->byte1 = 0;
369 str2b_dst->byte2 = *str_src;
373 HeapFree( GetProcessHeap(), 0, str );
375 return str2b;
378 static XChar2b* X11DRV_unicode_to_char2b_symbol( fontObject* pfo,
379 LPCWSTR lpwstr, UINT count )
381 XChar2b *str2b;
382 UINT i;
383 char ch = pfo->fs->default_char;
385 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
386 return NULL;
388 for (i = 0; i < count; i++)
390 str2b[i].byte1 = 0;
391 if(lpwstr[i] >= 0xf000 && lpwstr[i] < 0xf100)
392 str2b[i].byte2 = lpwstr[i] - 0xf000;
393 else if(lpwstr[i] < 0x100)
394 str2b[i].byte2 = lpwstr[i];
395 else
396 str2b[i].byte2 = ch;
399 return str2b;
403 static void X11DRV_DrawString_normal( fontObject* pfo, Display* pdisp,
404 Drawable d, GC gc, int x, int y,
405 XChar2b* pstr, int count )
407 wine_tsx11_lock();
408 XDrawString16( pdisp, d, gc, x, y, pstr, count );
409 wine_tsx11_unlock();
412 static int X11DRV_TextWidth_normal( fontObject* pfo, XChar2b* pstr, int count )
414 int ret;
415 wine_tsx11_lock();
416 ret = XTextWidth16( pfo->fs, pstr, count );
417 wine_tsx11_unlock();
418 return ret;
421 static void X11DRV_DrawText_normal( fontObject* pfo, Display* pdisp, Drawable d,
422 GC gc, int x, int y, XTextItem16* pitems,
423 int count )
425 wine_tsx11_lock();
426 XDrawText16( pdisp, d, gc, x, y, pitems, count );
427 wine_tsx11_unlock();
430 static void X11DRV_TextExtents_normal( fontObject* pfo, XChar2b* pstr, int count,
431 int* pdir, int* pascent, int* pdescent,
432 int* pwidth, int max_extent, int* pfit,
433 int* partial_extents )
435 XCharStruct info;
436 int ascent, descent, width;
437 int i, fit;
439 width = 0;
440 fit = 0;
441 *pascent = 0;
442 *pdescent = 0;
443 wine_tsx11_lock();
444 for ( i = 0; i < count; i++ )
446 XTextExtents16( pfo->fs, pstr, 1, pdir, &ascent, &descent, &info );
447 if ( *pascent < ascent ) *pascent = ascent;
448 if ( *pdescent < descent ) *pdescent = descent;
449 width += info.width;
450 if ( partial_extents ) partial_extents[i] = width;
451 if ( width < max_extent ) fit++;
453 pstr++;
455 wine_tsx11_unlock();
456 *pwidth = width;
457 if ( pfit ) *pfit = fit;
460 static void X11DRV_GetTextMetricsW_normal( fontObject* pfo, LPTEXTMETRICW pTM )
462 LPIFONTINFO16 pdf = &pfo->fi->df;
464 if( ! pfo->lpX11Trans ) {
465 pTM->tmAscent = pfo->fs->ascent;
466 pTM->tmDescent = pfo->fs->descent;
467 } else {
468 pTM->tmAscent = pfo->lpX11Trans->ascent;
469 pTM->tmDescent = pfo->lpX11Trans->descent;
472 pTM->tmAscent *= pfo->rescale;
473 pTM->tmDescent *= pfo->rescale;
475 pTM->tmHeight = pTM->tmAscent + pTM->tmDescent;
477 pTM->tmAveCharWidth = pfo->foAvgCharWidth * pfo->rescale;
478 pTM->tmMaxCharWidth = pfo->foMaxCharWidth * pfo->rescale;
480 pTM->tmInternalLeading = pfo->foInternalLeading * pfo->rescale;
481 pTM->tmExternalLeading = pdf->dfExternalLeading * pfo->rescale;
483 pTM->tmStruckOut = (pfo->fo_flags & FO_SYNTH_STRIKEOUT )
484 ? 1 : pdf->dfStrikeOut;
485 pTM->tmUnderlined = (pfo->fo_flags & FO_SYNTH_UNDERLINE )
486 ? 1 : pdf->dfUnderline;
488 pTM->tmOverhang = 0;
489 if( pfo->fo_flags & FO_SYNTH_ITALIC )
491 pTM->tmOverhang += pTM->tmHeight/3;
492 pTM->tmItalic = 1;
493 } else
494 pTM->tmItalic = pdf->dfItalic;
496 pTM->tmWeight = pdf->dfWeight;
497 if( pfo->fo_flags & FO_SYNTH_BOLD )
499 pTM->tmOverhang++;
500 pTM->tmWeight += 100;
503 pTM->tmFirstChar = pdf->dfFirstChar;
504 pTM->tmLastChar = pdf->dfLastChar;
505 pTM->tmDefaultChar = pdf->dfDefaultChar;
506 pTM->tmBreakChar = pdf->dfBreakChar;
508 pTM->tmCharSet = pdf->dfCharSet;
509 pTM->tmPitchAndFamily = pdf->dfPitchAndFamily;
511 pTM->tmDigitizedAspectX = pdf->dfHorizRes;
512 pTM->tmDigitizedAspectY = pdf->dfVertRes;
517 static
518 void X11DRV_DrawString_dbcs( fontObject* pfo, Display* pdisp,
519 Drawable d, GC gc, int x, int y,
520 XChar2b* pstr, int count )
522 XTextItem16 item;
524 item.chars = pstr;
525 item.delta = 0;
526 item.nchars = count;
527 item.font = None;
528 X11DRV_cptable[pfo->fi->cptable].pDrawText(
529 pfo, pdisp, d, gc, x, y, &item, 1 );
532 static
533 int X11DRV_TextWidth_dbcs_2fonts( fontObject* pfo, XChar2b* pstr, int count )
535 int i;
536 int width;
537 int curfont;
538 fontObject* pfos[X11FONT_REFOBJS_MAX+1];
540 pfos[0] = XFONT_GetFontObject( pfo->prefobjs[0] );
541 pfos[1] = pfo;
542 if ( pfos[0] == NULL ) pfos[0] = pfo;
544 width = 0;
545 wine_tsx11_lock();
546 for ( i = 0; i < count; i++ )
548 curfont = ( pstr->byte1 != 0 ) ? 1 : 0;
549 width += XTextWidth16( pfos[curfont]->fs, pstr, 1 );
550 pstr ++;
552 wine_tsx11_unlock();
553 return width;
556 static
557 void X11DRV_DrawText_dbcs_2fonts( fontObject* pfo, Display* pdisp, Drawable d,
558 GC gc, int x, int y, XTextItem16* pitems,
559 int count )
561 int i, nitems, prevfont = -1, curfont;
562 XChar2b* pstr;
563 XTextItem16* ptibuf;
564 XTextItem16* pti;
565 fontObject* pfos[X11FONT_REFOBJS_MAX+1];
567 pfos[0] = XFONT_GetFontObject( pfo->prefobjs[0] );
568 pfos[1] = pfo;
569 if ( pfos[0] == NULL ) pfos[0] = pfo;
571 nitems = 0;
572 for ( i = 0; i < count; i++ )
573 nitems += pitems->nchars;
574 ptibuf = HeapAlloc( GetProcessHeap(), 0, sizeof(XTextItem16) * nitems );
575 if ( ptibuf == NULL )
576 return; /* out of memory */
578 pti = ptibuf;
579 while ( count-- > 0 )
581 pti->chars = pstr = pitems->chars;
582 pti->delta = pitems->delta;
583 pti->font = None;
584 for ( i = 0; i < pitems->nchars; i++, pstr++ )
586 curfont = ( pstr->byte1 != 0 ) ? 1 : 0;
587 if ( curfont != prevfont )
589 if ( pstr != pti->chars )
591 pti->nchars = pstr - pti->chars;
592 pti ++;
593 pti->chars = pstr;
594 pti->delta = 0;
596 pti->font = pfos[curfont]->fs->fid;
597 prevfont = curfont;
600 pti->nchars = pstr - pti->chars;
601 pitems ++; pti ++;
603 wine_tsx11_lock();
604 XDrawText16( pdisp, d, gc, x, y, ptibuf, pti - ptibuf );
605 wine_tsx11_unlock();
606 HeapFree( GetProcessHeap(), 0, ptibuf );
609 static
610 void X11DRV_TextExtents_dbcs_2fonts( fontObject* pfo, XChar2b* pstr, int count,
611 int* pdir, int* pascent, int* pdescent,
612 int* pwidth, int max_extent, int* pfit,
613 int* partial_extents )
615 XCharStruct info;
616 int ascent, descent, width;
617 int i;
618 int fit;
619 int curfont;
620 fontObject* pfos[X11FONT_REFOBJS_MAX+1];
622 pfos[0] = XFONT_GetFontObject( pfo->prefobjs[0] );
623 pfos[1] = pfo;
624 if ( pfos[0] == NULL ) pfos[0] = pfo;
626 width = 0;
627 fit = 0;
628 *pascent = 0;
629 *pdescent = 0;
630 wine_tsx11_lock();
631 for ( i = 0; i < count; i++ )
633 curfont = ( pstr->byte1 != 0 ) ? 1 : 0;
634 XTextExtents16( pfos[curfont]->fs, pstr, 1, pdir, &ascent, &descent, &info );
635 if ( *pascent < ascent ) *pascent = ascent;
636 if ( *pdescent < descent ) *pdescent = descent;
637 width += info.width;
638 if ( partial_extents ) partial_extents[i] = width;
639 if ( width <= max_extent ) fit++;
641 pstr ++;
643 wine_tsx11_unlock();
644 *pwidth = width;
645 if ( pfit ) *pfit = fit;
648 static void X11DRV_GetTextMetricsW_cp932( fontObject* pfo, LPTEXTMETRICW pTM )
650 fontObject* pfo_ansi = XFONT_GetFontObject( pfo->prefobjs[0] );
651 LPIFONTINFO16 pdf = &pfo->fi->df;
652 LPIFONTINFO16 pdf_ansi;
654 pdf_ansi = ( pfo_ansi != NULL ) ? (&pfo_ansi->fi->df) : pdf;
656 if( ! pfo->lpX11Trans ) {
657 pTM->tmAscent = pfo->fs->ascent;
658 pTM->tmDescent = pfo->fs->descent;
659 } else {
660 pTM->tmAscent = pfo->lpX11Trans->ascent;
661 pTM->tmDescent = pfo->lpX11Trans->descent;
664 pTM->tmAscent *= pfo->rescale;
665 pTM->tmDescent *= pfo->rescale;
667 pTM->tmHeight = pTM->tmAscent + pTM->tmDescent;
669 if ( pfo_ansi != NULL )
671 pTM->tmAveCharWidth = floor((pfo_ansi->foAvgCharWidth * 2.0 + pfo->foAvgCharWidth) / 3.0 * pfo->rescale + 0.5);
672 pTM->tmMaxCharWidth = max(pfo_ansi->foMaxCharWidth, pfo->foMaxCharWidth) * pfo->rescale;
674 else
676 pTM->tmAveCharWidth = floor((pfo->foAvgCharWidth * pfo->rescale + 1.0) / 2.0);
677 pTM->tmMaxCharWidth = pfo->foMaxCharWidth * pfo->rescale;
680 pTM->tmInternalLeading = pfo->foInternalLeading * pfo->rescale;
681 pTM->tmExternalLeading = pdf->dfExternalLeading * pfo->rescale;
683 pTM->tmStruckOut = (pfo->fo_flags & FO_SYNTH_STRIKEOUT )
684 ? 1 : pdf->dfStrikeOut;
685 pTM->tmUnderlined = (pfo->fo_flags & FO_SYNTH_UNDERLINE )
686 ? 1 : pdf->dfUnderline;
688 pTM->tmOverhang = 0;
689 if( pfo->fo_flags & FO_SYNTH_ITALIC )
691 pTM->tmOverhang += pTM->tmHeight/3;
692 pTM->tmItalic = 1;
693 } else
694 pTM->tmItalic = pdf->dfItalic;
696 pTM->tmWeight = pdf->dfWeight;
697 if( pfo->fo_flags & FO_SYNTH_BOLD )
699 pTM->tmOverhang++;
700 pTM->tmWeight += 100;
703 pTM->tmFirstChar = pdf_ansi->dfFirstChar;
704 pTM->tmLastChar = pdf_ansi->dfLastChar;
705 pTM->tmDefaultChar = pdf_ansi->dfDefaultChar;
706 pTM->tmBreakChar = pdf_ansi->dfBreakChar;
708 pTM->tmCharSet = pdf->dfCharSet;
709 pTM->tmPitchAndFamily = pdf->dfPitchAndFamily;
711 pTM->tmDigitizedAspectX = pdf->dfHorizRes;
712 pTM->tmDigitizedAspectY = pdf->dfVertRes;
719 const X11DRV_CP X11DRV_cptable[X11DRV_CPTABLE_COUNT] =
721 { /* SBCS */
722 X11DRV_enum_subfont_charset_normal,
723 X11DRV_unicode_to_char2b_sbcs,
724 X11DRV_DrawString_normal,
725 X11DRV_TextWidth_normal,
726 X11DRV_DrawText_normal,
727 X11DRV_TextExtents_normal,
728 X11DRV_GetTextMetricsW_normal,
730 { /* UNICODE */
731 X11DRV_enum_subfont_charset_normal,
732 X11DRV_unicode_to_char2b_unicode,
733 X11DRV_DrawString_normal,
734 X11DRV_TextWidth_normal,
735 X11DRV_DrawText_normal,
736 X11DRV_TextExtents_normal,
737 X11DRV_GetTextMetricsW_normal,
739 { /* CP932 */
740 X11DRV_enum_subfont_charset_cp932,
741 X11DRV_unicode_to_char2b_cp932,
742 X11DRV_DrawString_dbcs,
743 X11DRV_TextWidth_dbcs_2fonts,
744 X11DRV_DrawText_dbcs_2fonts,
745 X11DRV_TextExtents_dbcs_2fonts,
746 X11DRV_GetTextMetricsW_cp932,
748 { /* CP936 */
749 X11DRV_enum_subfont_charset_cp936,
750 X11DRV_unicode_to_char2b_cp936,
751 X11DRV_DrawString_dbcs,
752 X11DRV_TextWidth_dbcs_2fonts,
753 X11DRV_DrawText_dbcs_2fonts,
754 X11DRV_TextExtents_dbcs_2fonts,
755 X11DRV_GetTextMetricsW_normal, /* FIXME */
757 { /* CP949 */
758 X11DRV_enum_subfont_charset_cp949,
759 X11DRV_unicode_to_char2b_cp949,
760 X11DRV_DrawString_dbcs,
761 X11DRV_TextWidth_dbcs_2fonts,
762 X11DRV_DrawText_dbcs_2fonts,
763 X11DRV_TextExtents_dbcs_2fonts,
764 X11DRV_GetTextMetricsW_normal, /* FIXME */
766 { /* CP950 */
767 X11DRV_enum_subfont_charset_cp950,
768 X11DRV_unicode_to_char2b_cp950,
769 X11DRV_DrawString_dbcs,
770 X11DRV_TextWidth_dbcs_2fonts,
771 X11DRV_DrawText_dbcs_2fonts,
772 X11DRV_TextExtents_dbcs_2fonts,
773 X11DRV_GetTextMetricsW_cp932,
775 { /* SYMBOL */
776 X11DRV_enum_subfont_charset_normal,
777 X11DRV_unicode_to_char2b_symbol,
778 X11DRV_DrawString_normal,
779 X11DRV_TextWidth_normal,
780 X11DRV_DrawText_normal,
781 X11DRV_TextExtents_normal,
782 X11DRV_GetTextMetricsW_normal,