DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Implementation

Untracked file

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 *
 * The contents of this file are subject to the Netscape Public License
 * Version 1.0 (the "NPL"); you may not use this file except in
 * compliance with the NPL.  You may obtain a copy of the NPL at
 * http://www.mozilla.org/NPL/
 *
 * Software distributed under the NPL is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
 * for the specific language governing rights and limitations under the
 * NPL.
 *
 * The Initial Developer of this code under the NPL is Netscape
 * Communications Corporation.  Portions created by Netscape are
 * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
 * Reserved.
 */
/* 
   fonts.h --- fonts, font selector, and related stuff
   Created: Erik van der Poel <erik@netscape.com>, 6-Oct-95.
 */


#ifndef __xfe_fonts_h_
#define __xfe_fonts_h_

#ifdef	__cplusplus
extern "C" {
#endif

#include "xp_core.h"
#include <lo_ele.h>
#include <X11/Xlib.h>

XP_BEGIN_PROTOS

/*
 * defines
 */

#define FE_FONT_TYPE_NONE	0x0
#define FE_FONT_TYPE_X8		0x1
#define FE_FONT_TYPE_X16	0x2
#define FE_FONT_TYPE_GROUP	0x4
#ifndef NO_WEB_FONTS
#define FE_FONT_TYPE_RENDERABLE 0x8
#endif


/* the following are macros so that we avoid the overhead of function calls */

#ifndef NO_WEB_FONTS
#define FE_TEXT_EXTENTS(charset, font, string, len, fontAscent, fontDescent,  \
        overall)                                                              \
do                                                                            \
{                                                                             \
        int             direction;                                            \
        fe_Font         platform_font;                                        \
        int             font_type;                                            \
                                                                              \
        platform_font = ((fe_FontWrap *) font)->platform_font;                \
        font_type = ((fe_FontWrap *) font)->distinguisher;                    \
                                                                              \
        if (FE_FONT_TYPE_X8 == font_type)                                     \
        {                                                                     \
                XTextExtents(((XFontStruct *) platform_font),                 \
                             (string), (len), &direction,                     \
                             (fontAscent), (fontDescent), (overall));         \
        }                                                                     \
        else if (FE_FONT_TYPE_X16 == font_type)                               \
        {                                                                     \
                XTextExtents16(((XFontStruct *) platform_font),               \
                               (XChar2b *) (string), (len)/2, &direction,     \
                               (fontAscent), (fontDescent), (overall));       \
        }                                                                     \
        else if (FE_FONT_TYPE_GROUP == font_type)                             \
        {                                                                     \
                (*fe_CharSetFuncsArray[fe_CharSetInfoArray[(charset) & 0xff]. \
                        info].textExtents)(platform_font, (string), (len),    \
                        &direction, (fontAscent), (fontDescent), (overall));  \
        }                                                                     \
        else                                                                  \
        {                                                                     \
            (overall)->width = nfrf_MeasureText(((struct nfrf *)              \
                platform_font), NULL, 0, string, len, NULL, 0, NULL);         \
            *(fontAscent) =                                                   \
                nfrf_GetFontAscent(((struct nfrf *) platform_font), NULL);    \
	    *(fontDescent) =                                                  \
                nfrf_GetFontDescent(((struct nfrf *) platform_font), NULL);   \
            (overall)->rbearing = (overall)->width;                           \
            (overall)->lbearing = 0;                                          \
            (overall)->ascent = *(fontAscent);                                \
   	    (overall)->descent = *(fontDescent);                              \
        }                                                                     \
} while (0)
#else
#define FE_TEXT_EXTENTS(charset, font, string, len, fontAscent, fontDescent,  \
        overall)                                                              \
do                                                                            \
{                                                                             \
        int             direction;                                            \
        int             type;                                                 \
                                                                              \
        type = fe_CharSetInfoArray[(charset) & 0xff].type;                    \
                                                                              \
        if (type == FE_FONT_TYPE_X8)                                          \
        {                                                                     \
                XTextExtents((font), (string), (len), &direction,             \
                        (fontAscent), (fontDescent), (overall));              \
        }                                                                     \
        else if (type == FE_FONT_TYPE_X16)                                    \
        {                                                                     \
                XTextExtents16((font), (XChar2b *) (string), (len)/2,         \
                        &direction, (fontAscent), (fontDescent), (overall));  \
        }                                                                     \
        else                                                                  \
        {                                                                     \
                (*fe_CharSetFuncsArray[fe_CharSetInfoArray[(charset) & 0xff]. \
                        info].textExtents)((font), (string), (len),           \
                        &direction, (fontAscent), (fontDescent), (overall));  \
        }                                                                     \
} while (0)
#endif

#ifndef NO_WEB_FONTS
#define FE_FONT_EXTENTS(charset, font, fontAscent, fontDescent)               \
do                                                                            \
{                                                                             \
        fe_Font         platform_font;                                        \
        int             font_type;                                            \
                                                                              \
        platform_font = ((fe_FontWrap *) font)->platform_font;                \
        font_type = ((fe_FontWrap *) font)->distinguisher;                    \
                                                                              \
	if ((FE_FONT_TYPE_X8 == font_type) || (FE_FONT_TYPE_X16 == font_type))\
        {                                                                     \
                *(fontAscent) = ((XFontStruct *) platform_font)->ascent;      \
                *(fontDescent) = ((XFontStruct *) platform_font)->descent;    \
        }                                                                     \
        else if (FE_FONT_TYPE_GROUP == font_type)                             \
        {                                                                     \
                fe_GenericFontExtents(charset, platform_font,                 \
                                        (fontAscent), (fontDescent));         \
        }                                                                     \
        else                                                                  \
        {                                                                     \
                *(fontAscent) =                                               \
                    nfrf_GetFontAscent(((struct nfrf *) platform_font),       \
                                       NULL);                                 \
                *(fontDescent) =                                              \
                    nfrf_GetFontDescent(((struct nfrf *) platform_font),      \
                                        NULL);                                \
         }                                                                    \
} while (0)
#else
#define FE_FONT_EXTENTS(charset, font, fontAscent, fontDescent)               \
do                                                                            \
{                                                                             \
        fe_CharSetInfo  *info;                                                \
                                                                              \
        info = &fe_CharSetInfoArray[(charset) & 0xff];                        \
                                                                              \
        if (info->type == FE_FONT_TYPE_GROUP)                                 \
        {                                                                     \
                fe_GenericFontExtents(charset, (font),                        \
                                        (fontAscent), (fontDescent));         \
        }                                                                     \
        else                                                                  \
        {                                                                     \
                *(fontAscent) = ((XFontStruct *) (font))->ascent;             \
                *(fontDescent) = ((XFontStruct *) (font))->descent;           \
        }                                                                     \
} while (0)
#endif

#ifndef NO_WEB_FONTS
#define FE_DRAW_STRING(charset, dpy, d, font, gc, x, y, string, len)          \
do                                                                            \
{                                                                             \
        int       font_type;                                                  \
        fe_Font   platform_font;                                              \
                                                                              \
        font_type = ((fe_FontWrap *) font)->distinguisher;                    \
        platform_font = ((fe_FontWrap *) font)->platform_font;                \
                                                                              \
        if (FE_FONT_TYPE_X8 == font_type)                                     \
        {                                                                     \
                XDrawString((dpy), (d), (gc), (x), (y), (string),             \
                        (len));                                               \
        }                                                                     \
        else if (FE_FONT_TYPE_X16 == font_type)                               \
        {                                                                     \
                XDrawString16((dpy), (d), (gc), (x), (y),                     \
                        (XChar2b *) (string), (len)/2);                       \
        }                                                                     \
        else if (FE_FONT_TYPE_GROUP == font_type)                             \
        {                                                                     \
                (*fe_CharSetFuncsArray[fe_CharSetInfoArray[(charset) & 0xff]. \
                        info].drawString)((dpy), (d), platform_font,          \
                        (gc), (x), (y), (string), (len));                     \
        }                                                                     \
        else                                                                  \
        {                                                                     \
 	        struct nfrc *   rc;                                           \
                void *          rcbuf[4];                                     \
                                                                              \
                rcbuf[0] = (dpy);                                             \
                rcbuf[1] = (void *) (d);                                      \
                rcbuf[2] = (gc);                                              \
                rc = nffbu_CreateRenderingContext(fe_FontUtility,             \
                                                  NF_RC_DIRECT, 0, rcbuf, 3,  \
                                                  NULL);                      \
 	        (void) nfrf_DrawText(((struct nfrf *) platform_font), rc,     \
                                     (x), (y), 0, (string), (len), NULL);     \
                nfrc_release(rc, NULL);                                       \
        }                                                                     \
} while (0)
#else
#define FE_DRAW_STRING(charset, dpy, d, font, gc, x, y, string, len)          \
do                                                                            \
{                                                                             \
        int  type;                                                            \
                                                                              \
        type = fe_CharSetInfoArray[(charset) & 0xff].type;                    \
                                                                              \
        if (type == FE_FONT_TYPE_X8)                                          \
        {                                                                     \
                XDrawString((dpy), (d), (gc), (x), (y), (string),             \
                        (len));                                               \
        }                                                                     \
        else if (type == FE_FONT_TYPE_X16)                                    \
        {                                                                     \
                XDrawString16((dpy), (d), (gc), (x), (y),                     \
                        (XChar2b *) (string), (len)/2);                       \
        }                                                                     \
        else                                                                  \
        {                                                                     \
                (*fe_CharSetFuncsArray[fe_CharSetInfoArray[(charset) & 0xff]. \
                        info].drawString)((dpy), (d), (font),                 \
                        (gc), (x), (y), (string), (len));                     \
        }                                                                     \
} while (0)
#endif

#ifndef NO_WEB_FONTS
#define FE_DRAW_IMAGE_STRING(charset, dpy, d, font, gc, gc2, x, y, string, len) \
do                                                                            \
{                                                                             \
        int       font_type;                                                  \
        fe_Font   platform_font;                                              \
                                                                              \
        font_type = ((fe_FontWrap *) font)->distinguisher;                    \
        platform_font = ((fe_FontWrap *) font)->platform_font;                \
                                                                              \
        if (FE_FONT_TYPE_X8 == font_type)                                     \
        {                                                                     \
                XDrawImageString((dpy), (d), (gc), (x), (y),                  \
                        (string), (len));                                     \
        }                                                                     \
        else if (FE_FONT_TYPE_X16 == font_type)                               \
        {                                                                     \
                XDrawImageString16((dpy), (d), (gc), (x), (y),                \
                        (XChar2b *) (string), (len)/2);                       \
        }                                                                     \
        else if (FE_FONT_TYPE_GROUP == font_type)                             \
        {                                                                     \
                (*fe_CharSetFuncsArray[fe_CharSetInfoArray[(charset) & 0xff]. \
                        info].drawImageString)((dpy), (d), platform_font,     \
                        (gc), (gc2), (x), (y), (string), (len));              \
        }                                                                     \
        else                                                                  \
        {                                                                     \
	        struct nfrc *rc;                                              \
	        void * rcbuf[4];                                              \
                                                                              \
	        rcbuf[0] = (dpy);                                             \
	        rcbuf[1] = (void *) (d);                                      \
	        rcbuf[2] = (gc);                                              \
                rcbuf[3] = (void *)(NF_DrawImageTextMask);                            \
	        rc = nffbu_CreateRenderingContext(fe_FontUtility,             \
                                                  NF_RC_DIRECT,               \
					          0, rcbuf, 4, NULL);         \
	        (void) nfrf_DrawText(((struct nfrf *) platform_font), rc,     \
                                     (x), (y), 0, (string), (len), NULL);     \
	        nfrc_release(rc, NULL);                                       \
        }                                                                     \
} while (0)
#else
#define FE_DRAW_IMAGE_STRING(charset, dpy, d, font, gc, gc2, x, y, string, len) \
do                                                                            \
{                                                                             \
        int  type;                                                            \
                                                                              \
        type = fe_CharSetInfoArray[(charset) & 0xff].type;                    \
                                                                              \
        if (type == FE_FONT_TYPE_X8)                                          \
        {                                                                     \
                XDrawImageString((dpy), (d), (gc), (x), (y), (string),        \
                                 (len));                                      \
        }                                                                     \
        else if (type == FE_FONT_TYPE_X16)                                    \
        {                                                                     \
                XDrawImageString16((dpy), (d), (gc), (x), (y),                \
                        (XChar2b *) (string), (len)/2);                       \
        }                                                                     \
        else                                                                  \
        {                                                                     \
                (*fe_CharSetFuncsArray[fe_CharSetInfoArray[(charset) & 0xff]. \
                        info].drawImageString)((dpy), (d),                    \
                        (font), (gc), (gc2), (x), (y), (string), (len));      \
        }                                                                     \
} while (0)
#endif


#ifndef NO_WEB_FONTS
#define FE_SET_GC_FONT(charset, gc, font, flags)                              \
do                                                                            \
{                                                                             \
        int       font_type;                                                  \
        fe_Font   platform_font;                                              \
                                                                              \
        font_type = ((fe_FontWrap *) font)->distinguisher;                    \
        platform_font = ((fe_FontWrap *) font)->platform_font;                \
                                                                              \
        if ((FE_FONT_TYPE_X8 == font_type) ||                                 \
            (FE_FONT_TYPE_X16 == font_type))                                  \
        {                                                                     \
                (gc)->font = ((XFontStruct *) platform_font)->fid;            \
                *(flags) |= GCFont;                                           \
        }                                                                     \
} while (0)
#else
#define FE_SET_GC_FONT(charset, gc, font, flags)                              \
do                                                                            \
{                                                                             \
        fe_CharSetInfo  *info;                                                \
                                                                              \
        info = &fe_CharSetInfoArray[(charset) & 0xff];                        \
                                                                              \
        if (info->type != FE_FONT_TYPE_GROUP)                                 \
        {                                                                     \
                (gc)->font = ((XFontStruct *) (font))->fid;                   \
                *(flags) |= GCFont;                                           \
        }                                                                     \
} while (0)
#endif

#ifndef NO_WEB_FONTS
#define FE_NONEDIT_FONTLIST(charset, font, fontlist)                          \
do                                                                            \
{                                                                             \
        fe_Font   platform_font;                                              \
                                                                              \
        fe_CharSetFuncs entry =                                               \
           fe_CharSetFuncsArray[fe_CharSetInfoArray[(charset) & 0xff].info];  \
                                                                              \
        platform_font = ((fe_FontWrap *) font)->platform_font;                \
                                                                              \
        (fontlist) =                                                          \
        (* (entry.nonEditGetFontList))(charset, platform_font,                \
                               (int)entry.numberOfFonts);                     \
} while(0)
#else
#define FE_NONEDIT_FONTLIST(charset, font, fontlist)                          \
do                                                                            \
{                                                                             \
        fe_CharSetFuncs entry =                                               \
           fe_CharSetFuncsArray[fe_CharSetInfoArray[(charset) & 0xff].info];  \
                                                                              \
        (fontlist) =                                                          \
        (* (entry.nonEditGetFontList))( charset, font,                        \
                              (int) entry.numberOfFonts);                     \
} while(0)
#endif


#ifndef NO_WEB_FONTS
#define FE_NONEDIT_TO_XMSTRING(charset, font, string, len)                    \
        (*fe_CharSetFuncsArray[fe_CharSetInfoArray[(charset) & 0xff].         \
                        info].nonEditToXmString)( (charset),                  \
                           (fe_Font) (((fe_FontWrap *) font)->platform_font), \
                                      (string),                               \
                                      (len)                                   \
                              )                                              
#else
#define FE_NONEDIT_TO_XMSTRING(charset, font, string, len)                    \
        (*fe_CharSetFuncsArray[fe_CharSetInfoArray[(charset) & 0xff].         \
                        info].nonEditToXmString)((charset),                   \
                             (fe_Font)(font),                                 \
                                      (string),                               \
                                      (len)                                   \
                              )                                              
#endif

/*
 * typedefs and structs
 */

#ifndef NO_WEB_FONTS
typedef struct fe_FontWrap
{
        unsigned char    distinguisher;
        void *           platform_font;
} fe_FontWrap;
#endif

typedef void *fe_Font;

typedef struct fe_FontFace fe_FontFace;

struct fe_FontFace
{
	fe_FontFace	*next;

	char		*longXLFDFontName;

	fe_Font		font;
	fe_Font		javafont;
	XP_Bool         loaded;
};


typedef struct fe_FontSize fe_FontSize;

struct fe_FontSize
{
	fe_FontSize	*next;

	int		size;

	/* whether the user has selected this size in preferences */
	unsigned int	selected : 1;

        /* whether this record is in the css pool */
        unsigned int    in_pool: 1;

	/* 0 = normal, 1 = bold, 2 = italic, 3 = boldItalic */
	fe_FontFace	*faces[4];

};


typedef struct fe_FontFamily
{
	/* displayed name of this family/foundry */
	char		*name;

	/* XLFD name of foundry */
	char		*foundry;

	/* XLFD name of family */
	char		*family;

	/* whether the user has selected this family in preferences */
	unsigned int	selected : 1;

	/* whether not to allow scaling for this family */
	unsigned int	allowScaling : 1;

	/* whether the htmlSizes have been computer or not */
	unsigned int	htmlSizesComputed : 1;

	/* one for each document size, 1-7 */
	fe_FontSize	*htmlSizes[7];

	/* selected size if scaled font */
	int		scaledSize;

	/* pointer to all pixel sizes within this family */
	fe_FontSize	*pixelSizes;

	/* allocated size of pixelSizes array */
	short		pixelAlloc;

	/* actual number of pixel sizes */
	short		numberOfPixelSizes;

	/* pointer to all point sizes within this family */
	fe_FontSize	*pointSizes;

	/* allocated size of pointSizes array */
	short		pointAlloc;

	/* actual number of point sizes */
	short		numberOfPointSizes;

        /* pointer to list of temporarily instantiated point sizes */
        fe_FontSize     *pool;
} fe_FontFamily;


/* one for each pitch: proportional and fixed */
typedef struct fe_FontPitch
{
	/* pointer to size menu for this pitch */
	Widget		sizeMenu;

	/* pointer to all families of this charset/pitch */
	fe_FontFamily	*families;

	/* allocated size of families array */
	short		alloc;

	/* actual number of families */
	short		numberOfFamilies;

	/* selected family */
	fe_FontFamily	*selectedFamily;

} fe_FontPitch;


/* we have one of these per charset */
typedef struct fe_FontCharSet
{
	/* displayed name of this charset */
	char		*name;

	/* official MIME name of this charset */
	char		*mimeName;

	/* whether the user has selected this one in the preferences */
	unsigned int	selected : 1;

	/* the two pitches: 0 = proportional and 1 = fixed */
	fe_FontPitch	pitches[2];

} fe_FontCharSet;


typedef struct fe_CharSetInfo
{
	int16			charsetID;
	unsigned char		type;
	unsigned char		info;
} fe_CharSetInfo;


typedef XP_Bool (*fe_AreFontsAvailFunc)(int16 win_csid);
typedef fe_Font (*fe_LoadFontFunc)(MWContext *context, char *familyName,
	int points, int sizeNum, int fontmask, int charset, int pitch,
        int faceNum, Display *dpy);
typedef void (*fe_TextExtentsFunc)(fe_Font font, char *string, int len,
	int *dir, int *fontAscent, int *fontDescent, XCharStruct *overall);
typedef void (*fe_DrawStringFunc)(Display *dpy, Drawable d, fe_Font font,
	GC gc, int x, int y, char *string, int len);
typedef void (*fe_DrawImageStringFunc)(Display *dpy, Drawable d, fe_Font font,
	GC gc, GC gc2, int x, int y, char *string, int len);
typedef XmFontList (*fe_GetFontList)(int16 charset, fe_Font font, int numOfFont);
typedef XmString (*fe_ToXmString)(int16 charset, fe_Font font, char* string, int len );

typedef struct fe_CharSetFuncs
{
	unsigned char			numberOfFonts;
	fe_AreFontsAvailFunc		areFontsAvail;
	fe_LoadFontFunc			loadFont;
	fe_TextExtentsFunc		textExtents;
	fe_DrawStringFunc		drawString;
	fe_DrawImageStringFunc		drawImageString;
	fe_GetFontList			nonEditGetFontList;
	fe_ToXmString			nonEditToXmString;
} fe_CharSetFuncs;


typedef struct fe_FontSettings fe_FontSettings;

struct fe_FontSettings
{
	fe_FontSettings	*next;
	char		*spec;
};


/*
 * public data
 */

extern fe_FontCharSet fe_FontCharSets[];

extern unsigned char fe_SortedFontCharSets[];

extern fe_CharSetInfo fe_CharSetInfoArray[];

extern fe_CharSetFuncs fe_CharSetFuncsArray[];

#ifndef NO_WEB_FONTS
extern struct nffbu * fe_FontUtility;
#endif

/*
 * public functions
 */
XP_Bool fe_IsCharSetSupported(int16 doc_csid);
XP_Bool fe_AreFontsAvail(int16 win_csid);

fe_Font fe_LoadUnicodeFont(void *, char *familyName, int points,
                           int sizeNum, int fontmask, int charset,
                           int pitch, int faceNum, Display *dpy);
void fe_FreeUnicodeFonts(void);

XmString fe_utf8_to_XmString(fe_Font, char *, int, XmFontList *);

void fe_ComputeFontSizeTable(fe_FontFamily *family);

void fe_FreeFontGroups(void);

void fe_FreeFonts(void);

void fe_FreeFontSettings(fe_FontSettings *set);

void fe_FreeFontSizeTable(fe_FontFamily *family);

void fe_GenericFontExtents(int num, fe_Font font, int *fontAscent,
	int *fontDescent);

char *fe_GetFontCharSetSetting(void);

XtPointer fe_GetFont(MWContext *context, int sizeNum, int fontmask);

XtPointer fe_GetFontOrFontSet(MWContext *context, char *familyName,
			      int sizeNum, int fontmask, XmFontType *type);

XtPointer fe_GetFontOrFontSetFromFace(MWContext *context, LO_TextAttr *attr,
				      char *net_font_face, int sizeNum,
				      int fontmask, XmFontType *type);

fe_FontSettings *fe_GetFontSettings(void);

int fe_GetStrikePosition(int charset, fe_Font font);

int fe_GetUnderlinePosition(int charset);

void fe_InitFonts(Display *dpy);

#ifndef NO_WEB_FONTS
extern void fe_DoneWithFont(fe_Font font);
#endif

fe_Font fe_LoadFontFromFace(MWContext *context, LO_TextAttr *attr, int16 *charset,
			    char *net_font_face, int size, int fontmask);

void fe_ReadFontCharSet(char *charset);

void fe_ReadFontSpec(char *spec);

void fe_SetFontSettings(fe_FontSettings *set);

XP_END_PROTOS
int fe_WebfontsNeedReload(MWContext *context);


#ifdef	__cplusplus
}
#endif

#endif /* __xfe_fonts_h_ */