Release 1.1.37.
[wine/gsoc-2012-control.git] / dlls / winex11.drv / codepage.c
blobfe918bc63136850130f6736abde032d452aae6f8
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 ) ) );
66 /***********************************************************************
67 * DBCSCharToXChar2b for cp932/euc
70 static inline
71 void DBCSCharToXChar2b_cp932( XChar2b* pch, BYTE lead, BYTE trail )
73 unsigned int high, low;
75 high = (unsigned int)lead;
76 low = (unsigned int)trail;
78 if ( high <= 0x9f )
79 high = (high<<1) - 0xe0;
80 else
81 high = (high<<1) - 0x160;
82 if ( low < 0x9f )
84 high --;
85 if ( low < 0x7f )
86 low -= 0x1f;
87 else
88 low -= 0x20;
90 else
92 low -= 0x7e;
95 pch->byte1 = (unsigned char)high;
96 pch->byte2 = (unsigned char)low;
100 static WORD X11DRV_enum_subfont_charset_normal( UINT index )
102 return DEFAULT_CHARSET;
105 static WORD X11DRV_enum_subfont_charset_cp932( UINT index )
107 switch ( index )
109 case 0: return X11FONT_JISX0201_CHARSET;
110 case 1: return X11FONT_JISX0212_CHARSET;
113 return DEFAULT_CHARSET;
116 static WORD X11DRV_enum_subfont_charset_cp936( UINT index )
118 switch ( index )
120 case 0: return ANSI_CHARSET;
123 return DEFAULT_CHARSET;
126 static WORD X11DRV_enum_subfont_charset_cp949( UINT index )
128 switch ( index )
130 case 0: return ANSI_CHARSET;
133 return DEFAULT_CHARSET;
136 static WORD X11DRV_enum_subfont_charset_cp950( UINT index )
138 switch ( index )
140 case 0: return ANSI_CHARSET;
143 return DEFAULT_CHARSET;
147 static XChar2b* X11DRV_unicode_to_char2b_sbcs( fontObject* pfo,
148 LPCWSTR lpwstr, UINT count )
150 XChar2b *str2b;
151 UINT i;
152 char *str;
153 UINT codepage = pfo->fi->codepage;
154 char ch = pfo->fs->default_char;
156 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
157 return NULL;
158 if (!(str = HeapAlloc( GetProcessHeap(), 0, count )))
160 HeapFree( GetProcessHeap(), 0, str2b );
161 return NULL;
164 WideCharToMultiByte( codepage, 0, lpwstr, count, str, count, &ch, NULL );
166 for (i = 0; i < count; i++)
168 str2b[i].byte1 = 0;
169 str2b[i].byte2 = str[i];
171 HeapFree( GetProcessHeap(), 0, str );
173 return str2b;
176 static XChar2b* X11DRV_unicode_to_char2b_unicode( fontObject* pfo,
177 LPCWSTR lpwstr, UINT count )
179 XChar2b *str2b;
180 UINT i;
182 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
183 return NULL;
185 for (i = 0; i < count; i++)
187 str2b[i].byte1 = lpwstr[i] >> 8;
188 str2b[i].byte2 = lpwstr[i] & 0xff;
191 return str2b;
194 /* FIXME: handle jisx0212.1990... */
195 static XChar2b* X11DRV_unicode_to_char2b_cp932( fontObject* pfo,
196 LPCWSTR lpwstr, UINT count )
198 XChar2b *str2b;
199 XChar2b *str2b_dst;
200 char *str;
201 BYTE *str_src;
202 UINT i;
203 char ch = pfo->fs->default_char;
205 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
206 return NULL;
207 if (!(str = HeapAlloc( GetProcessHeap(), 0, count*2 )))
209 HeapFree( GetProcessHeap(), 0, str2b );
210 return NULL;
213 /* handle jisx0212.1990... */
214 WideCharToMultiByte( 932, 0, lpwstr, count, str, count*2, &ch, NULL );
216 str_src = (BYTE*) str;
217 str2b_dst = str2b;
218 for (i = 0; i < count; i++, str_src++, str2b_dst++)
220 if ( IsLegalDBCSChar_cp932( *str_src, *(str_src+1) ) )
222 DBCSCharToXChar2b_cp932( str2b_dst, *str_src, *(str_src+1) );
223 str_src++;
225 else
227 str2b_dst->byte1 = 0;
228 str2b_dst->byte2 = *str_src;
232 HeapFree( GetProcessHeap(), 0, str );
234 return str2b;
238 static XChar2b* X11DRV_unicode_to_char2b_cp936( fontObject* pfo,
239 LPCWSTR lpwstr, UINT count )
241 XChar2b *str2b;
242 XChar2b *str2b_dst;
243 char *str;
244 BYTE *str_src;
245 UINT i;
246 char ch = pfo->fs->default_char;
248 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
249 return NULL;
250 if (!(str = HeapAlloc( GetProcessHeap(), 0, count*2 )))
252 HeapFree( GetProcessHeap(), 0, str2b );
253 return NULL;
255 WideCharToMultiByte( 936, 0, lpwstr, count, str, count*2, &ch, NULL );
257 str_src = (BYTE*) str;
258 str2b_dst = str2b;
259 for (i = 0; i < count; i++, str_src++, str2b_dst++)
261 if ( IsLegalDBCSChar_cp936( *str_src, *(str_src+1) ) )
263 str2b_dst->byte1 = *str_src;
264 str2b_dst->byte2 = *(str_src+1);
265 str_src++;
267 else
269 str2b_dst->byte1 = 0;
270 str2b_dst->byte2 = *str_src;
274 HeapFree( GetProcessHeap(), 0, str );
276 return str2b;
279 static XChar2b* X11DRV_unicode_to_char2b_cp949( fontObject* pfo,
280 LPCWSTR lpwstr, UINT count )
282 XChar2b *str2b;
283 XChar2b *str2b_dst;
284 char *str;
285 BYTE *str_src;
286 UINT i;
287 char ch = pfo->fs->default_char;
289 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
290 return NULL;
291 if (!(str = HeapAlloc( GetProcessHeap(), 0, count*2 )))
293 HeapFree( GetProcessHeap(), 0, str2b );
294 return NULL;
296 WideCharToMultiByte( 949, 0, lpwstr, count, str, count*2, &ch, NULL );
298 str_src = (BYTE*) str;
299 str2b_dst = str2b;
300 for (i = 0; i < count; i++, str_src++, str2b_dst++)
302 if ( IsLegalDBCSChar_cp949( *str_src, *(str_src+1) ) )
304 str2b_dst->byte1 = *str_src;
305 str2b_dst->byte2 = *(str_src+1);
306 str_src++;
308 else
310 str2b_dst->byte1 = 0;
311 str2b_dst->byte2 = *str_src;
315 HeapFree( GetProcessHeap(), 0, str );
317 return str2b;
321 static XChar2b* X11DRV_unicode_to_char2b_cp950( fontObject* pfo,
322 LPCWSTR lpwstr, UINT count )
324 XChar2b *str2b;
325 XChar2b *str2b_dst;
326 char *str;
327 BYTE *str_src;
328 UINT i;
329 char ch = pfo->fs->default_char;
331 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
332 return NULL;
333 if (!(str = HeapAlloc( GetProcessHeap(), 0, count*2 )))
335 HeapFree( GetProcessHeap(), 0, str2b );
336 return NULL;
338 WideCharToMultiByte( 950, 0, lpwstr, count, str, count*2, &ch, NULL );
340 str_src = (BYTE*) str;
341 str2b_dst = str2b;
342 for (i = 0; i < count; i++, str_src++, str2b_dst++)
344 if ( IsLegalDBCSChar_cp950( *str_src, *(str_src+1) ) )
346 str2b_dst->byte1 = *str_src;
347 str2b_dst->byte2 = *(str_src+1);
348 str_src++;
350 else
352 str2b_dst->byte1 = 0;
353 str2b_dst->byte2 = *str_src;
357 HeapFree( GetProcessHeap(), 0, str );
359 return str2b;
362 static XChar2b* X11DRV_unicode_to_char2b_symbol( fontObject* pfo,
363 LPCWSTR lpwstr, UINT count )
365 XChar2b *str2b;
366 UINT i;
367 char ch = pfo->fs->default_char;
369 if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
370 return NULL;
372 for (i = 0; i < count; i++)
374 str2b[i].byte1 = 0;
375 if(lpwstr[i] >= 0xf000 && lpwstr[i] < 0xf100)
376 str2b[i].byte2 = lpwstr[i] - 0xf000;
377 else if(lpwstr[i] < 0x100)
378 str2b[i].byte2 = lpwstr[i];
379 else
380 str2b[i].byte2 = ch;
383 return str2b;
387 static void X11DRV_DrawString_normal( fontObject* pfo, Display* pdisp,
388 Drawable d, GC gc, int x, int y,
389 XChar2b* pstr, int count )
391 wine_tsx11_lock();
392 XDrawString16( pdisp, d, gc, x, y, pstr, count );
393 wine_tsx11_unlock();
396 static int X11DRV_TextWidth_normal( fontObject* pfo, XChar2b* pstr, int count )
398 int ret;
399 wine_tsx11_lock();
400 ret = XTextWidth16( pfo->fs, pstr, count );
401 wine_tsx11_unlock();
402 return ret;
405 static void X11DRV_DrawText_normal( fontObject* pfo, Display* pdisp, Drawable d,
406 GC gc, int x, int y, XTextItem16* pitems,
407 int count )
409 wine_tsx11_lock();
410 XDrawText16( pdisp, d, gc, x, y, pitems, count );
411 wine_tsx11_unlock();
414 static void X11DRV_TextExtents_normal( fontObject* pfo, XChar2b* pstr, int count,
415 int* pdir, int* pascent, int* pdescent,
416 int* pwidth, int max_extent, int* pfit,
417 int* partial_extents )
419 XCharStruct info;
420 int ascent, descent, width;
421 int i, fit;
423 width = 0;
424 fit = 0;
425 *pascent = 0;
426 *pdescent = 0;
427 wine_tsx11_lock();
428 for ( i = 0; i < count; i++ )
430 XTextExtents16( pfo->fs, pstr, 1, pdir, &ascent, &descent, &info );
431 if ( *pascent < ascent ) *pascent = ascent;
432 if ( *pdescent < descent ) *pdescent = descent;
433 width += info.width;
434 if ( partial_extents ) partial_extents[i] = width;
435 if ( width < max_extent ) fit++;
437 pstr++;
439 wine_tsx11_unlock();
440 *pwidth = width;
441 if ( pfit ) *pfit = fit;
444 static void X11DRV_GetTextMetricsW_normal( fontObject* pfo, LPTEXTMETRICW pTM )
446 LPIFONTINFO16 pdf = &pfo->fi->df;
448 if( ! pfo->lpX11Trans ) {
449 pTM->tmAscent = pfo->fs->ascent;
450 pTM->tmDescent = pfo->fs->descent;
451 } else {
452 pTM->tmAscent = pfo->lpX11Trans->ascent;
453 pTM->tmDescent = pfo->lpX11Trans->descent;
456 pTM->tmAscent *= pfo->rescale;
457 pTM->tmDescent *= pfo->rescale;
459 pTM->tmHeight = pTM->tmAscent + pTM->tmDescent;
461 pTM->tmAveCharWidth = pfo->foAvgCharWidth * pfo->rescale;
462 pTM->tmMaxCharWidth = pfo->foMaxCharWidth * pfo->rescale;
464 pTM->tmInternalLeading = pfo->foInternalLeading * pfo->rescale;
465 pTM->tmExternalLeading = pdf->dfExternalLeading * pfo->rescale;
467 pTM->tmStruckOut = (pfo->fo_flags & FO_SYNTH_STRIKEOUT )
468 ? 1 : pdf->dfStrikeOut;
469 pTM->tmUnderlined = (pfo->fo_flags & FO_SYNTH_UNDERLINE )
470 ? 1 : pdf->dfUnderline;
472 pTM->tmOverhang = 0;
473 if( pfo->fo_flags & FO_SYNTH_ITALIC )
475 pTM->tmOverhang += pTM->tmHeight/3;
476 pTM->tmItalic = 1;
477 } else
478 pTM->tmItalic = pdf->dfItalic;
480 pTM->tmWeight = pdf->dfWeight;
481 if( pfo->fo_flags & FO_SYNTH_BOLD )
483 pTM->tmOverhang++;
484 pTM->tmWeight += 100;
487 pTM->tmFirstChar = pdf->dfFirstChar;
488 pTM->tmLastChar = pdf->dfLastChar;
489 pTM->tmDefaultChar = pdf->dfDefaultChar;
490 pTM->tmBreakChar = pdf->dfBreakChar;
492 pTM->tmCharSet = pdf->dfCharSet;
493 pTM->tmPitchAndFamily = pdf->dfPitchAndFamily;
495 pTM->tmDigitizedAspectX = pdf->dfHorizRes;
496 pTM->tmDigitizedAspectY = pdf->dfVertRes;
501 static
502 void X11DRV_DrawString_dbcs( fontObject* pfo, Display* pdisp,
503 Drawable d, GC gc, int x, int y,
504 XChar2b* pstr, int count )
506 XTextItem16 item;
508 item.chars = pstr;
509 item.delta = 0;
510 item.nchars = count;
511 item.font = None;
512 X11DRV_cptable[pfo->fi->cptable].pDrawText(
513 pfo, pdisp, d, gc, x, y, &item, 1 );
516 static
517 int X11DRV_TextWidth_dbcs_2fonts( fontObject* pfo, XChar2b* pstr, int count )
519 int i;
520 int width;
521 int curfont;
522 fontObject* pfos[X11FONT_REFOBJS_MAX+1];
524 pfos[0] = XFONT_GetFontObject( pfo->prefobjs[0] );
525 pfos[1] = pfo;
526 if ( pfos[0] == NULL ) pfos[0] = pfo;
528 width = 0;
529 wine_tsx11_lock();
530 for ( i = 0; i < count; i++ )
532 curfont = ( pstr->byte1 != 0 ) ? 1 : 0;
533 width += XTextWidth16( pfos[curfont]->fs, pstr, 1 );
534 pstr ++;
536 wine_tsx11_unlock();
537 return width;
540 static
541 void X11DRV_DrawText_dbcs_2fonts( fontObject* pfo, Display* pdisp, Drawable d,
542 GC gc, int x, int y, XTextItem16* pitems,
543 int count )
545 int i, nitems, prevfont = -1, curfont;
546 XChar2b* pstr;
547 XTextItem16* ptibuf;
548 XTextItem16* pti;
549 fontObject* pfos[X11FONT_REFOBJS_MAX+1];
551 pfos[0] = XFONT_GetFontObject( pfo->prefobjs[0] );
552 pfos[1] = pfo;
553 if ( pfos[0] == NULL ) pfos[0] = pfo;
555 nitems = 0;
556 for ( i = 0; i < count; i++ )
557 nitems += pitems->nchars;
558 ptibuf = HeapAlloc( GetProcessHeap(), 0, sizeof(XTextItem16) * nitems );
559 if ( ptibuf == NULL )
560 return; /* out of memory */
562 pti = ptibuf;
563 while ( count-- > 0 )
565 pti->chars = pstr = pitems->chars;
566 pti->delta = pitems->delta;
567 pti->font = None;
568 for ( i = 0; i < pitems->nchars; i++, pstr++ )
570 curfont = ( pstr->byte1 != 0 ) ? 1 : 0;
571 if ( curfont != prevfont )
573 if ( pstr != pti->chars )
575 pti->nchars = pstr - pti->chars;
576 pti ++;
577 pti->chars = pstr;
578 pti->delta = 0;
580 pti->font = pfos[curfont]->fs->fid;
581 prevfont = curfont;
584 pti->nchars = pstr - pti->chars;
585 pitems ++; pti ++;
587 wine_tsx11_lock();
588 XDrawText16( pdisp, d, gc, x, y, ptibuf, pti - ptibuf );
589 wine_tsx11_unlock();
590 HeapFree( GetProcessHeap(), 0, ptibuf );
593 static
594 void X11DRV_TextExtents_dbcs_2fonts( fontObject* pfo, XChar2b* pstr, int count,
595 int* pdir, int* pascent, int* pdescent,
596 int* pwidth, int max_extent, int* pfit,
597 int* partial_extents )
599 XCharStruct info;
600 int ascent, descent, width;
601 int i;
602 int fit;
603 int curfont;
604 fontObject* pfos[X11FONT_REFOBJS_MAX+1];
606 pfos[0] = XFONT_GetFontObject( pfo->prefobjs[0] );
607 pfos[1] = pfo;
608 if ( pfos[0] == NULL ) pfos[0] = pfo;
610 width = 0;
611 fit = 0;
612 *pascent = 0;
613 *pdescent = 0;
614 wine_tsx11_lock();
615 for ( i = 0; i < count; i++ )
617 curfont = ( pstr->byte1 != 0 ) ? 1 : 0;
618 XTextExtents16( pfos[curfont]->fs, pstr, 1, pdir, &ascent, &descent, &info );
619 if ( *pascent < ascent ) *pascent = ascent;
620 if ( *pdescent < descent ) *pdescent = descent;
621 width += info.width;
622 if ( partial_extents ) partial_extents[i] = width;
623 if ( width <= max_extent ) fit++;
625 pstr ++;
627 wine_tsx11_unlock();
628 *pwidth = width;
629 if ( pfit ) *pfit = fit;
632 static void X11DRV_GetTextMetricsW_cp932( fontObject* pfo, LPTEXTMETRICW pTM )
634 fontObject* pfo_ansi = XFONT_GetFontObject( pfo->prefobjs[0] );
635 LPIFONTINFO16 pdf = &pfo->fi->df;
636 LPIFONTINFO16 pdf_ansi;
638 pdf_ansi = ( pfo_ansi != NULL ) ? (&pfo_ansi->fi->df) : pdf;
640 if( ! pfo->lpX11Trans ) {
641 pTM->tmAscent = pfo->fs->ascent;
642 pTM->tmDescent = pfo->fs->descent;
643 } else {
644 pTM->tmAscent = pfo->lpX11Trans->ascent;
645 pTM->tmDescent = pfo->lpX11Trans->descent;
648 pTM->tmAscent *= pfo->rescale;
649 pTM->tmDescent *= pfo->rescale;
651 pTM->tmHeight = pTM->tmAscent + pTM->tmDescent;
653 if ( pfo_ansi != NULL )
655 pTM->tmAveCharWidth = floor((pfo_ansi->foAvgCharWidth * 2.0 + pfo->foAvgCharWidth) / 3.0 * pfo->rescale + 0.5);
656 pTM->tmMaxCharWidth = max(pfo_ansi->foMaxCharWidth, pfo->foMaxCharWidth) * pfo->rescale;
658 else
660 pTM->tmAveCharWidth = floor((pfo->foAvgCharWidth * pfo->rescale + 1.0) / 2.0);
661 pTM->tmMaxCharWidth = pfo->foMaxCharWidth * pfo->rescale;
664 pTM->tmInternalLeading = pfo->foInternalLeading * pfo->rescale;
665 pTM->tmExternalLeading = pdf->dfExternalLeading * pfo->rescale;
667 pTM->tmStruckOut = (pfo->fo_flags & FO_SYNTH_STRIKEOUT )
668 ? 1 : pdf->dfStrikeOut;
669 pTM->tmUnderlined = (pfo->fo_flags & FO_SYNTH_UNDERLINE )
670 ? 1 : pdf->dfUnderline;
672 pTM->tmOverhang = 0;
673 if( pfo->fo_flags & FO_SYNTH_ITALIC )
675 pTM->tmOverhang += pTM->tmHeight/3;
676 pTM->tmItalic = 1;
677 } else
678 pTM->tmItalic = pdf->dfItalic;
680 pTM->tmWeight = pdf->dfWeight;
681 if( pfo->fo_flags & FO_SYNTH_BOLD )
683 pTM->tmOverhang++;
684 pTM->tmWeight += 100;
687 pTM->tmFirstChar = pdf_ansi->dfFirstChar;
688 pTM->tmLastChar = pdf_ansi->dfLastChar;
689 pTM->tmDefaultChar = pdf_ansi->dfDefaultChar;
690 pTM->tmBreakChar = pdf_ansi->dfBreakChar;
692 pTM->tmCharSet = pdf->dfCharSet;
693 pTM->tmPitchAndFamily = pdf->dfPitchAndFamily;
695 pTM->tmDigitizedAspectX = pdf->dfHorizRes;
696 pTM->tmDigitizedAspectY = pdf->dfVertRes;
703 const X11DRV_CP X11DRV_cptable[X11DRV_CPTABLE_COUNT] =
705 { /* SBCS */
706 X11DRV_enum_subfont_charset_normal,
707 X11DRV_unicode_to_char2b_sbcs,
708 X11DRV_DrawString_normal,
709 X11DRV_TextWidth_normal,
710 X11DRV_DrawText_normal,
711 X11DRV_TextExtents_normal,
712 X11DRV_GetTextMetricsW_normal,
714 { /* UNICODE */
715 X11DRV_enum_subfont_charset_normal,
716 X11DRV_unicode_to_char2b_unicode,
717 X11DRV_DrawString_normal,
718 X11DRV_TextWidth_normal,
719 X11DRV_DrawText_normal,
720 X11DRV_TextExtents_normal,
721 X11DRV_GetTextMetricsW_normal,
723 { /* CP932 */
724 X11DRV_enum_subfont_charset_cp932,
725 X11DRV_unicode_to_char2b_cp932,
726 X11DRV_DrawString_dbcs,
727 X11DRV_TextWidth_dbcs_2fonts,
728 X11DRV_DrawText_dbcs_2fonts,
729 X11DRV_TextExtents_dbcs_2fonts,
730 X11DRV_GetTextMetricsW_cp932,
732 { /* CP936 */
733 X11DRV_enum_subfont_charset_cp936,
734 X11DRV_unicode_to_char2b_cp936,
735 X11DRV_DrawString_dbcs,
736 X11DRV_TextWidth_dbcs_2fonts,
737 X11DRV_DrawText_dbcs_2fonts,
738 X11DRV_TextExtents_dbcs_2fonts,
739 X11DRV_GetTextMetricsW_normal, /* FIXME */
741 { /* CP949 */
742 X11DRV_enum_subfont_charset_cp949,
743 X11DRV_unicode_to_char2b_cp949,
744 X11DRV_DrawString_dbcs,
745 X11DRV_TextWidth_dbcs_2fonts,
746 X11DRV_DrawText_dbcs_2fonts,
747 X11DRV_TextExtents_dbcs_2fonts,
748 X11DRV_GetTextMetricsW_normal, /* FIXME */
750 { /* CP950 */
751 X11DRV_enum_subfont_charset_cp950,
752 X11DRV_unicode_to_char2b_cp950,
753 X11DRV_DrawString_dbcs,
754 X11DRV_TextWidth_dbcs_2fonts,
755 X11DRV_DrawText_dbcs_2fonts,
756 X11DRV_TextExtents_dbcs_2fonts,
757 X11DRV_GetTextMetricsW_cp932,
759 { /* SYMBOL */
760 X11DRV_enum_subfont_charset_normal,
761 X11DRV_unicode_to_char2b_symbol,
762 X11DRV_DrawString_normal,
763 X11DRV_TextWidth_normal,
764 X11DRV_DrawText_normal,
765 X11DRV_TextExtents_normal,
766 X11DRV_GetTextMetricsW_normal,