home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / fonts.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  28.5 KB  |  607 lines

  1. /* -*- Mode: C; tab-width: 8; 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.    fonts.h --- fonts, font selector, and related stuff
  20.    Created: Erik van der Poel <erik@netscape.com>, 6-Oct-95.
  21.  */
  22.  
  23.  
  24. #ifndef __xfe_fonts_h_
  25. #define __xfe_fonts_h_
  26.  
  27. #ifdef    __cplusplus
  28. extern "C" {
  29. #endif
  30.  
  31. #include "xp_core.h"
  32. #include <lo_ele.h>
  33. #include <X11/Xlib.h>
  34.  
  35. XP_BEGIN_PROTOS
  36.  
  37. /*
  38.  * defines
  39.  */
  40.  
  41. #define FE_FONT_TYPE_X8        0x1
  42. #define FE_FONT_TYPE_X16    0x2
  43. #define FE_FONT_TYPE_GROUP    0x4
  44. #ifndef NO_WEB_FONTS
  45. #define FE_FONT_TYPE_RENDERABLE 0x8
  46. #endif
  47.  
  48.  
  49. /* the following are macros so that we avoid the overhead of function calls */
  50.  
  51. #ifndef NO_WEB_FONTS
  52. #define FE_TEXT_EXTENTS(charset, font, string, len, fontAscent, fontDescent,  \
  53.         overall)                                                              \
  54. do                                                                            \
  55. {                                                                             \
  56.         int             direction;                                            \
  57.         fe_Font         platform_font;                                        \
  58.         int             font_type;                                            \
  59.                                                                               \
  60.         platform_font = ((fe_FontWrap *) font)->platform_font;                \
  61.         font_type = ((fe_FontWrap *) font)->distinguisher;                    \
  62.                                                                               \
  63.         if (FE_FONT_TYPE_X8 == font_type)                                     \
  64.         {                                                                     \
  65.                 XTextExtents(((XFontStruct *) platform_font),                 \
  66.                              (string), (len), &direction,                     \
  67.                              (fontAscent), (fontDescent), (overall));         \
  68.         }                                                                     \
  69.         else if (FE_FONT_TYPE_X16 == font_type)                               \
  70.         {                                                                     \
  71.                 XTextExtents16(((XFontStruct *) platform_font),               \
  72.                                (XChar2b *) (string), (len)/2, &direction,     \
  73.                                (fontAscent), (fontDescent), (overall));       \
  74.         }                                                                     \
  75.         else if (FE_FONT_TYPE_GROUP == font_type)                             \
  76.         {                                                                     \
  77.                 (*fe_CharSetFuncsArray[fe_CharSetInfoArray[(charset) & 0xff]. \
  78.                         info].textExtents)(platform_font, (string), (len),    \
  79.                         &direction, (fontAscent), (fontDescent), (overall));  \
  80.         }                                                                     \
  81.         else                                                                  \
  82.         {                                                                     \
  83.             (overall)->width = nfrf_MeasureText(((struct nfrf *)              \
  84.                 platform_font), NULL, 0, string, len, NULL, 0, NULL);         \
  85.             *(fontAscent) =                                                   \
  86.                 nfrf_GetFontAscent(((struct nfrf *) platform_font), NULL);    \
  87.         *(fontDescent) =                                                  \
  88.                 nfrf_GetFontDescent(((struct nfrf *) platform_font), NULL);   \
  89.             (overall)->rbearing = (overall)->width;                           \
  90.             (overall)->lbearing = 0;                                          \
  91.             (overall)->ascent = *(fontAscent);                                \
  92.            (overall)->descent = *(fontDescent);                              \
  93.         }                                                                     \
  94. } while (0)
  95. #else
  96. #define FE_TEXT_EXTENTS(charset, font, string, len, fontAscent, fontDescent,  \
  97.         overall)                                                              \
  98. do                                                                            \
  99. {                                                                             \
  100.         int             direction;                                            \
  101.         int             type;                                                 \
  102.                                                                               \
  103.         type = fe_CharSetInfoArray[(charset) & 0xff].type;                    \
  104.                                                                               \
  105.         if (type == FE_FONT_TYPE_X8)                                          \
  106.         {                                                                     \
  107.                 XTextExtents((font), (string), (len), &direction,             \
  108.                         (fontAscent), (fontDescent), (overall));              \
  109.         }                                                                     \
  110.         else if (type == FE_FONT_TYPE_X16)                                    \
  111.         {                                                                     \
  112.                 XTextExtents16((font), (XChar2b *) (string), (len)/2,         \
  113.                         &direction, (fontAscent), (fontDescent), (overall));  \
  114.         }                                                                     \
  115.         else                                                                  \
  116.         {                                                                     \
  117.                 (*fe_CharSetFuncsArray[fe_CharSetInfoArray[(charset) & 0xff]. \
  118.                         info].textExtents)((font), (string), (len),           \
  119.                         &direction, (fontAscent), (fontDescent), (overall));  \
  120.         }                                                                     \
  121. } while (0)
  122. #endif
  123.  
  124. #ifndef NO_WEB_FONTS
  125. #define FE_FONT_EXTENTS(charset, font, fontAscent, fontDescent)               \
  126. do                                                                            \
  127. {                                                                             \
  128.         fe_Font         platform_font;                                        \
  129.         int             font_type;                                            \
  130.                                                                               \
  131.         platform_font = ((fe_FontWrap *) font)->platform_font;                \
  132.         font_type = ((fe_FontWrap *) font)->distinguisher;                    \
  133.                                                                               \
  134.     if ((FE_FONT_TYPE_X8 == font_type) || (FE_FONT_TYPE_X16 == font_type))\
  135.         {                                                                     \
  136.                 *(fontAscent) = ((XFontStruct *) platform_font)->ascent;      \
  137.                 *(fontDescent) = ((XFontStruct *) platform_font)->descent;    \
  138.         }                                                                     \
  139.         else if (FE_FONT_TYPE_GROUP == font_type)                             \
  140.         {                                                                     \
  141.                 fe_GenericFontExtents(charset, platform_font,                 \
  142.                                         (fontAscent), (fontDescent));         \
  143.         }                                                                     \
  144.         else                                                                  \
  145.         {                                                                     \
  146.                 *(fontAscent) =                                               \
  147.                     nfrf_GetFontAscent(((struct nfrf *) platform_font),       \
  148.                                        NULL);                                 \
  149.                 *(fontDescent) =                                              \
  150.                     nfrf_GetFontDescent(((struct nfrf *) platform_font),      \
  151.                                         NULL);                                \
  152.          }                                                                    \
  153. } while (0)
  154. #else
  155. #define FE_FONT_EXTENTS(charset, font, fontAscent, fontDescent)               \
  156. do                                                                            \
  157. {                                                                             \
  158.         fe_CharSetInfo  *info;                                                \
  159.                                                                               \
  160.         info = &fe_CharSetInfoArray[(charset) & 0xff];                        \
  161.                                                                               \
  162.         if (info->type == FE_FONT_TYPE_GROUP)                                 \
  163.         {                                                                     \
  164.                 fe_GenericFontExtents(charset, (font),                        \
  165.                                         (fontAscent), (fontDescent));         \
  166.         }                                                                     \
  167.         else                                                                  \
  168.         {                                                                     \
  169.                 *(fontAscent) = ((XFontStruct *) (font))->ascent;             \
  170.                 *(fontDescent) = ((XFontStruct *) (font))->descent;           \
  171.         }                                                                     \
  172. } while (0)
  173. #endif
  174.  
  175. #ifndef NO_WEB_FONTS
  176. #define FE_DRAW_STRING(charset, dpy, d, font, gc, x, y, string, len)          \
  177. do                                                                            \
  178. {                                                                             \
  179.         int       font_type;                                                  \
  180.         fe_Font   platform_font;                                              \
  181.                                                                               \
  182.         font_type = ((fe_FontWrap *) font)->distinguisher;                    \
  183.         platform_font = ((fe_FontWrap *) font)->platform_font;                \
  184.                                                                               \
  185.         if (FE_FONT_TYPE_X8 == font_type)                                     \
  186.         {                                                                     \
  187.                 XDrawString((dpy), (d), (gc), (x), (y), (string),             \
  188.                         (len));                                               \
  189.         }                                                                     \
  190.         else if (FE_FONT_TYPE_X16 == font_type)                               \
  191.         {                                                                     \
  192.                 XDrawString16((dpy), (d), (gc), (x), (y),                     \
  193.                         (XChar2b *) (string), (len)/2);                       \
  194.         }                                                                     \
  195.         else if (FE_FONT_TYPE_GROUP == font_type)                             \
  196.         {                                                                     \
  197.                 (*fe_CharSetFuncsArray[fe_CharSetInfoArray[(charset) & 0xff]. \
  198.                         info].drawString)((dpy), (d), platform_font,          \
  199.                         (gc), (x), (y), (string), (len));                     \
  200.         }                                                                     \
  201.         else                                                                  \
  202.         {                                                                     \
  203.              struct nfrc *   rc;                                           \
  204.                 void *          rcbuf[4];                                     \
  205.                                                                               \
  206.                 rcbuf[0] = (dpy);                                             \
  207.                 rcbuf[1] = (void *) (d);                                      \
  208.                 rcbuf[2] = (gc);                                              \
  209.                 rc = nffbu_CreateRenderingContext(fe_FontUtility,             \
  210.                                                   NF_RC_DIRECT, 0, rcbuf, 3,  \
  211.                                                   NULL);                      \
  212.              (void) nfrf_DrawText(((struct nfrf *) platform_font), rc,     \
  213.                                      (x), (y), 0, (string), (len), NULL);     \
  214.                 nfrc_release(rc, NULL);                                       \
  215.         }                                                                     \
  216. } while (0)
  217. #else
  218. #define FE_DRAW_STRING(charset, dpy, d, font, gc, x, y, string, len)          \
  219. do                                                                            \
  220. {                                                                             \
  221.         int  type;                                                            \
  222.                                                                               \
  223.         type = fe_CharSetInfoArray[(charset) & 0xff].type;                    \
  224.                                                                               \
  225.         if (type == FE_FONT_TYPE_X8)                                          \
  226.         {                                                                     \
  227.                 XDrawString((dpy), (d), (gc), (x), (y), (string),             \
  228.                         (len));                                               \
  229.         }                                                                     \
  230.         else if (type == FE_FONT_TYPE_X16)                                    \
  231.         {                                                                     \
  232.                 XDrawString16((dpy), (d), (gc), (x), (y),                     \
  233.                         (XChar2b *) (string), (len)/2);                       \
  234.         }                                                                     \
  235.         else                                                                  \
  236.         {                                                                     \
  237.                 (*fe_CharSetFuncsArray[fe_CharSetInfoArray[(charset) & 0xff]. \
  238.                         info].drawString)((dpy), (d), (font),                 \
  239.                         (gc), (x), (y), (string), (len));                     \
  240.         }                                                                     \
  241. } while (0)
  242. #endif
  243.  
  244. #ifndef NO_WEB_FONTS
  245. #define FE_DRAW_IMAGE_STRING(charset, dpy, d, font, gc, gc2, x, y, string, len) \
  246. do                                                                            \
  247. {                                                                             \
  248.         int       font_type;                                                  \
  249.         fe_Font   platform_font;                                              \
  250.                                                                               \
  251.         font_type = ((fe_FontWrap *) font)->distinguisher;                    \
  252.         platform_font = ((fe_FontWrap *) font)->platform_font;                \
  253.                                                                               \
  254.         if (FE_FONT_TYPE_X8 == font_type)                                     \
  255.         {                                                                     \
  256.                 XDrawImageString((dpy), (d), (gc), (x), (y),                  \
  257.                         (string), (len));                                     \
  258.         }                                                                     \
  259.         else if (FE_FONT_TYPE_X16 == font_type)                               \
  260.         {                                                                     \
  261.                 XDrawImageString16((dpy), (d), (gc), (x), (y),                \
  262.                         (XChar2b *) (string), (len)/2);                       \
  263.         }                                                                     \
  264.         else if (FE_FONT_TYPE_GROUP == font_type)                             \
  265.         {                                                                     \
  266.                 (*fe_CharSetFuncsArray[fe_CharSetInfoArray[(charset) & 0xff]. \
  267.                         info].drawImageString)((dpy), (d), platform_font,     \
  268.                         (gc), (gc2), (x), (y), (string), (len));              \
  269.         }                                                                     \
  270.         else                                                                  \
  271.         {                                                                     \
  272.             struct nfrc *rc;                                              \
  273.             void * rcbuf[4];                                              \
  274.                                                                               \
  275.             rcbuf[0] = (dpy);                                             \
  276.             rcbuf[1] = (void *) (d);                                      \
  277.             rcbuf[2] = (gc);                                              \
  278.                 rcbuf[3] = (void *)(NF_DrawImageTextMask);                            \
  279.             rc = nffbu_CreateRenderingContext(fe_FontUtility,             \
  280.                                                   NF_RC_DIRECT,               \
  281.                               0, rcbuf, 4, NULL);         \
  282.             (void) nfrf_DrawText(((struct nfrf *) platform_font), rc,     \
  283.                                      (x), (y), 0, (string), (len), NULL);     \
  284.             nfrc_release(rc, NULL);                                       \
  285.         }                                                                     \
  286. } while (0)
  287. #else
  288. #define FE_DRAW_IMAGE_STRING(charset, dpy, d, font, gc, gc2, x, y, string, len) \
  289. do                                                                            \
  290. {                                                                             \
  291.         int  type;                                                            \
  292.                                                                               \
  293.         type = fe_CharSetInfoArray[(charset) & 0xff].type;                    \
  294.                                                                               \
  295.         if (type == FE_FONT_TYPE_X8)                                          \
  296.         {                                                                     \
  297.                 XDrawImageString((dpy), (d), (gc), (x), (y), (string),        \
  298.                                  (len));                                      \
  299.         }                                                                     \
  300.         else if (type == FE_FONT_TYPE_X16)                                    \
  301.         {                                                                     \
  302.                 XDrawImageString16((dpy), (d), (gc), (x), (y),                \
  303.                         (XChar2b *) (string), (len)/2);                       \
  304.         }                                                                     \
  305.         else                                                                  \
  306.         {                                                                     \
  307.                 (*fe_CharSetFuncsArray[fe_CharSetInfoArray[(charset) & 0xff]. \
  308.                         info].drawImageString)((dpy), (d),                    \
  309.                         (font), (gc), (gc2), (x), (y), (string), (len));      \
  310.         }                                                                     \
  311. } while (0)
  312. #endif
  313.  
  314.  
  315. #ifndef NO_WEB_FONTS
  316. #define FE_SET_GC_FONT(charset, gc, font, flags)                              \
  317. do                                                                            \
  318. {                                                                             \
  319.         int       font_type;                                                  \
  320.         fe_Font   platform_font;                                              \
  321.                                                                               \
  322.         font_type = ((fe_FontWrap *) font)->distinguisher;                    \
  323.         platform_font = ((fe_FontWrap *) font)->platform_font;                \
  324.                                                                               \
  325.         if ((FE_FONT_TYPE_X8 == font_type) ||                                 \
  326.             (FE_FONT_TYPE_X16 == font_type))                                  \
  327.         {                                                                     \
  328.                 (gc)->font = ((XFontStruct *) platform_font)->fid;            \
  329.                 *(flags) |= GCFont;                                           \
  330.         }                                                                     \
  331. } while (0)
  332. #else
  333. #define FE_SET_GC_FONT(charset, gc, font, flags)                              \
  334. do                                                                            \
  335. {                                                                             \
  336.         fe_CharSetInfo  *info;                                                \
  337.                                                                               \
  338.         info = &fe_CharSetInfoArray[(charset) & 0xff];                        \
  339.                                                                               \
  340.         if (info->type != FE_FONT_TYPE_GROUP)                                 \
  341.         {                                                                     \
  342.                 (gc)->font = ((XFontStruct *) (font))->fid;                   \
  343.                 *(flags) |= GCFont;                                           \
  344.         }                                                                     \
  345. } while (0)
  346. #endif
  347.  
  348.  
  349. /*
  350.  * typedefs and structs
  351.  */
  352.  
  353. #ifndef NO_WEB_FONTS
  354. typedef struct fe_FontWrap
  355. {
  356.         unsigned char    distinguisher;
  357.         void *           platform_font;
  358. } fe_FontWrap;
  359. #endif
  360.  
  361. typedef void *fe_Font;
  362.  
  363. typedef struct fe_FontFace fe_FontFace;
  364.  
  365. struct fe_FontFace
  366. {
  367.     fe_FontFace    *next;
  368.  
  369.     char        *longXLFDFontName;
  370.  
  371.     fe_Font        font;
  372.     fe_Font        javafont;
  373.     XP_Bool         loaded;
  374. };
  375.  
  376.  
  377. typedef struct fe_FontSize fe_FontSize;
  378.  
  379. struct fe_FontSize
  380. {
  381.     fe_FontSize    *next;
  382.  
  383.     int        size;
  384.  
  385.     /* whether the user has selected this size in preferences */
  386.     unsigned int    selected : 1;
  387.  
  388.         /* whether this record is in the css pool */
  389.         unsigned int    in_pool: 1;
  390.  
  391.     /* 0 = normal, 1 = bold, 2 = italic, 3 = boldItalic */
  392.     fe_FontFace    *faces[4];
  393.  
  394. };
  395.  
  396.  
  397. typedef struct fe_FontFamily
  398. {
  399.     /* displayed name of this family/foundry */
  400.     char        *name;
  401.  
  402.     /* XLFD name of foundry */
  403.     char        *foundry;
  404.  
  405.     /* XLFD name of family */
  406.     char        *family;
  407.  
  408.     /* whether the user has selected this family in preferences */
  409.     unsigned int    selected : 1;
  410.  
  411.     /* whether not to allow scaling for this family */
  412.     unsigned int    allowScaling : 1;
  413.  
  414.     /* whether the htmlSizes have been computer or not */
  415.     unsigned int    htmlSizesComputed : 1;
  416.  
  417.     /* one for each document size, 1-7 */
  418.     fe_FontSize    *htmlSizes[7];
  419.  
  420.     /* selected size if scaled font */
  421.     int        scaledSize;
  422.  
  423.     /* pointer to all pixel sizes within this family */
  424.     fe_FontSize    *pixelSizes;
  425.  
  426.     /* allocated size of pixelSizes array */
  427.     short        pixelAlloc;
  428.  
  429.     /* actual number of pixel sizes */
  430.     short        numberOfPixelSizes;
  431.  
  432.     /* pointer to all point sizes within this family */
  433.     fe_FontSize    *pointSizes;
  434.  
  435.     /* allocated size of pointSizes array */
  436.     short        pointAlloc;
  437.  
  438.     /* actual number of point sizes */
  439.     short        numberOfPointSizes;
  440.  
  441.         /* pointer to list of temporarily instantiated point sizes */
  442.         fe_FontSize     *pool;
  443. } fe_FontFamily;
  444.  
  445.  
  446. /* one for each pitch: proportional and fixed */
  447. typedef struct fe_FontPitch
  448. {
  449.     /* pointer to size menu for this pitch */
  450.     Widget        sizeMenu;
  451.  
  452.     /* pointer to all families of this charset/pitch */
  453.     fe_FontFamily    *families;
  454.  
  455.     /* allocated size of families array */
  456.     short        alloc;
  457.  
  458.     /* actual number of families */
  459.     short        numberOfFamilies;
  460.  
  461.     /* selected family */
  462.     fe_FontFamily    *selectedFamily;
  463.  
  464. } fe_FontPitch;
  465.  
  466.  
  467. /* we have one of these per charset */
  468. typedef struct fe_FontCharSet
  469. {
  470.     /* displayed name of this charset */
  471.     char        *name;
  472.  
  473.     /* official MIME name of this charset */
  474.     char        *mimeName;
  475.  
  476.     /* whether the user has selected this one in the preferences */
  477.     unsigned int    selected : 1;
  478.  
  479.     /* the two pitches: 0 = proportional and 1 = fixed */
  480.     fe_FontPitch    pitches[2];
  481.  
  482. } fe_FontCharSet;
  483.  
  484.  
  485. typedef struct fe_CharSetInfo
  486. {
  487.     int16            charsetID;
  488.     unsigned char        type;
  489.     unsigned char        info;
  490. } fe_CharSetInfo;
  491.  
  492.  
  493. typedef XP_Bool (*fe_AreFontsAvailFunc)(int16 win_csid);
  494. typedef fe_Font (*fe_LoadFontFunc)(MWContext *context, char *familyName,
  495.     int points, int sizeNum, int fontmask, int charset, int pitch,
  496.         int faceNum, Display *dpy);
  497. typedef void (*fe_TextExtentsFunc)(fe_Font font, char *string, int len,
  498.     int *dir, int *fontAscent, int *fontDescent, XCharStruct *overall);
  499. typedef void (*fe_DrawStringFunc)(Display *dpy, Drawable d, fe_Font font,
  500.     GC gc, int x, int y, char *string, int len);
  501. typedef void (*fe_DrawImageStringFunc)(Display *dpy, Drawable d, fe_Font font,
  502.     GC gc, GC gc2, int x, int y, char *string, int len);
  503.  
  504. typedef struct fe_CharSetFuncs
  505. {
  506.     unsigned char            numberOfFonts;
  507.     fe_AreFontsAvailFunc    areFontsAvail;
  508.     fe_LoadFontFunc            loadFont;
  509.     fe_TextExtentsFunc        textExtents;
  510.     fe_DrawStringFunc        drawString;
  511.     fe_DrawImageStringFunc    drawImageString;
  512. } fe_CharSetFuncs;
  513.  
  514.  
  515. typedef struct fe_FontSettings fe_FontSettings;
  516.  
  517. struct fe_FontSettings
  518. {
  519.     fe_FontSettings    *next;
  520.     char        *spec;
  521. };
  522.  
  523.  
  524. /*
  525.  * public data
  526.  */
  527.  
  528. extern fe_FontCharSet fe_FontCharSets[];
  529.  
  530. extern unsigned char fe_SortedFontCharSets[];
  531.  
  532. extern fe_CharSetInfo fe_CharSetInfoArray[];
  533.  
  534. extern fe_CharSetFuncs fe_CharSetFuncsArray[];
  535.  
  536. #ifndef NO_WEB_FONTS
  537. extern struct nffbu * fe_FontUtility;
  538. #endif
  539.  
  540. /*
  541.  * public functions
  542.  */
  543. XP_Bool fe_IsCharSetSupported(int16 doc_csid);
  544. XP_Bool fe_AreFontsAvail(int16 win_csid);
  545.  
  546. fe_Font fe_LoadUnicodeFont(void *, char *familyName, int points,
  547.                            int sizeNum, int fontmask, int charset,
  548.                            int pitch, int faceNum, Display *dpy);
  549. void fe_FreeUnicodeFonts(void);
  550.  
  551. XmString fe_utf8_to_XmString(fe_Font, char *, int, XmFontList *);
  552.  
  553. void fe_ComputeFontSizeTable(fe_FontFamily *family);
  554.  
  555. void fe_FreeFontGroups(void);
  556.  
  557. void fe_FreeFonts(void);
  558.  
  559. void fe_FreeFontSettings(fe_FontSettings *set);
  560.  
  561. void fe_FreeFontSizeTable(fe_FontFamily *family);
  562.  
  563. void fe_GenericFontExtents(int num, fe_Font font, int *fontAscent,
  564.     int *fontDescent);
  565.  
  566. char *fe_GetFontCharSetSetting(void);
  567.  
  568. XtPointer fe_GetFont(MWContext *context, int sizeNum, int fontmask);
  569.  
  570. XtPointer fe_GetFontOrFontSet(MWContext *context, char *familyName,
  571.                   int sizeNum, int fontmask, XmFontType *type);
  572.  
  573. XtPointer fe_GetFontOrFontSetFromFace(MWContext *context, LO_TextAttr *attr,
  574.                       char *net_font_face, int sizeNum,
  575.                       int fontmask, XmFontType *type);
  576.  
  577. fe_FontSettings *fe_GetFontSettings(void);
  578.  
  579. int fe_GetStrikePosition(int charset, fe_Font font);
  580.  
  581. int fe_GetUnderlinePosition(int charset);
  582.  
  583. void fe_InitFonts(Display *dpy);
  584.  
  585. #ifndef NO_WEB_FONTS
  586. extern void fe_DoneWithFont(fe_Font font);
  587. #endif
  588.  
  589. fe_Font fe_LoadFontFromFace(MWContext *context, LO_TextAttr *attr, int16 *charset,
  590.                 char *net_font_face, int size, int fontmask);
  591.  
  592. void fe_ReadFontCharSet(char *charset);
  593.  
  594. void fe_ReadFontSpec(char *spec);
  595.  
  596. void fe_SetFontSettings(fe_FontSettings *set);
  597.  
  598. XP_END_PROTOS
  599. int fe_WebfontsNeedReload(MWContext *context);
  600.  
  601.  
  602. #ifdef    __cplusplus
  603. }
  604. #endif
  605.  
  606. #endif /* __xfe_fonts_h_ */
  607.