home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / include / xupfonts.h < prev   
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.6 KB  |  77 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. /* xupfonts.h - X Unicode Pseudo FONTS Header file */
  20.  
  21. #ifndef XUPFONTS_H
  22. #define XUPFONTS_H
  23.  
  24. #define UNICODE_PSEUDO_FONT_TAG   0xabadbeef
  25. #define UNICODE_PLACEHOLDER_WIDTH 10
  26. typedef struct fe_UnicodePseudoFont
  27. {
  28.     unsigned int tag;
  29.     char *family;
  30.     XFontStruct    *xFonts[INTL_CHAR_SET_MAX];
  31.     char xfont_inited[INTL_CHAR_SET_MAX];
  32.     char xfont_scaled[INTL_CHAR_SET_MAX];
  33.     char* xfont_name[INTL_CHAR_SET_MAX];
  34.     char *fontFamily[INTL_CHAR_SET_MAX];
  35.     char larger_fonts_avail[INTL_CHAR_SET_MAX];
  36.     XmFontList xmfontlist;
  37.     XFontSet xfontset;
  38.     XmFontList xm_fontset;
  39.     Display *dpy;
  40.     int pitch;
  41.     int sizeNum;
  42.     int fontmask;
  43.     int faceNum;
  44.     int pixelSize;
  45.     int ascent;
  46.     int descent;
  47. } fe_UnicodePseudoFont;
  48.  
  49. XFontStruct *fe_UnicodeGetXfont(fe_UnicodePseudoFont *ufont, uint16 encoding);
  50.  
  51. int fe_DrawUCS2String(Display *dpy, Drawable d, fe_Font font, GC gc, int x,
  52.     int y, uint16 *string, int len);
  53.  
  54. void fe_freeUnicodePseudoFont(fe_Font font);
  55.  
  56. fe_Font fe_LoadUnicodeFontByPixelSize(void *not_used, char *familyName, 
  57.     int pixelSize, int fontmask, int charset, int pitch, int faceNum,
  58.          Display *dpy);
  59.  
  60. void fe_UCS2TextExtents(fe_Font font, uint16 *string, int len, int *direction, 
  61.                 int *fontAscent, int *fontDescent, XCharStruct *overall);
  62.  
  63. void fe_UTF8TextExtents(fe_Font font, char *string, int len, int *direction,
  64.     int *fontAscent, int *fontDescent, XCharStruct *overall);
  65.  
  66. void fe_DrawUTF8String(Display *dpy, Drawable d, fe_Font font, GC gc, int x,
  67.     int y, char *string, int len);
  68.  
  69. fe_Font    XUPF_LoadDefaultFont(Display *dpy);
  70. XmFontList XUPF_GetXmFontList(fe_Font font);
  71. XmFontList XUPF_GetXmFontSet(fe_Font font);
  72. XmString   XUPF_UCS2ToXmString(uint16 *uniChars, int32 length, 
  73.                         fe_Font ufont, XmFontList *fontList);
  74. int XUPF_JavaPointToPixelSize(Display *dpy, int pointSize);
  75.  
  76. #endif /* XUPFONTS_H */
  77.