1 /* $XTermId: fontutils.h,v 1.82 2010/10/11 08:13:54 tom Exp $ */
3 /************************************************************
5 Copyright 1998-2009,2010 by Thomas E. Dickey
9 Permission is hereby granted, free of charge, to any person obtaining a
10 copy of this software and associated documentation files (the
11 "Software"), to deal in the Software without restriction, including
12 without limitation the rights to use, copy, modify, merge, publish,
13 distribute, sublicense, and/or sell copies of the Software, and to
14 permit persons to whom the Software is furnished to do so, subject to
15 the following conditions:
17 The above copyright notice and this permission notice shall be included
18 in all copies or substantial portions of the Software.
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
24 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 Except as contained in this notice, the name(s) of the above copyright
29 holders shall not be used in advertising or otherwise to promote the
30 sale, use or other dealings in this Software without prior written
33 ********************************************************/
35 #ifndef included_fontutils_h
36 #define included_fontutils_h 1
40 extern Bool xtermLoadDefaultFonts (XtermWidget /* xw */);
41 extern Bool xtermOpenFont (XtermWidget /* xw */, const char */* name */, XTermFonts * /* result */, fontWarningTypes /* warn */, Bool /* force */);
42 extern XTermFonts * xtermCloseFont (XtermWidget /* xw */, XTermFonts * /* fnt */);
43 extern const VTFontNames * xtermFontName (const char */* normal */);
44 extern int lookupRelativeFontSize (XtermWidget /* xw */, int /* old */, int /* relative */);
45 extern int xtermGetFont(const char * /* param */);
46 extern int xtermLoadFont (XtermWidget /* xw */, const VTFontNames */* fonts */, Bool /* doresize */, int /* fontnum */);
47 extern void HandleSetFont PROTO_XT_ACTIONS_ARGS;
48 extern void SetVTFont (XtermWidget /* xw */, int /* i */, Bool /* doresize */, const VTFontNames */* fonts */);
49 extern void xtermCloseFonts (XtermWidget /* xw */, XTermFonts * /* fnts[fMAX] */);
50 extern void xtermComputeFontInfo (XtermWidget /* xw */, VTwin */* win */, XFontStruct */* font */, int /* sbwidth */);
51 extern void xtermCopyFontInfo (XTermFonts * /* target */, XTermFonts * /* source */);
52 extern void xtermFreeFontInfo (XTermFonts * /* target */);
53 extern void xtermSaveFontInfo (TScreen * /* screen */, XFontStruct */* font */);
54 extern void xtermSetCursorBox (TScreen * /* screen */);
55 extern void xtermUpdateFontInfo (XtermWidget /* xw */, Bool /* doresize */);
58 extern char *xtermSpecialFont (TScreen */* screen */, unsigned /* atts */, unsigned /* chrset */);
63 #define FontIsIncomplete(font) \
65 && (font)->fs->per_char != 0 \
66 && !(font)->fs->all_chars_exist)
68 #define ForceBoxChars(screen,ch) \
69 (xtermIsDecGraphic(ch) \
70 && (screen)->force_box_chars)
73 #define CharKnownMissing(font, ch) \
74 (((ch) < 256) && ((font)->known_missing[(Char)(ch)] > 1))
76 #define CharKnownMissing(font, ch) \
77 ((font)->known_missing[(Char)(ch)] > 1)
80 #define IsXtermMissingChar(screen, ch, font) \
81 (CharKnownMissing(font, ch) \
82 ? ((font)->known_missing[(Char)(ch)] > 1) \
83 : ((FontIsIncomplete(font) && xtermMissingChar(ch, font)) \
84 || ForceBoxChars(screen, ch)))
86 extern Bool xtermMissingChar (unsigned /* ch */, XTermFonts */* font */);
87 extern void xtermDrawBoxChar (XtermWidget /* xw */, unsigned /* ch */, unsigned /* flags */, GC /* gc */, int /* x */, int /* y */, int /* cols */);
89 #define IsXtermMissingChar(screen, ch, font) False
93 extern void HandleLoadVTFonts PROTO_XT_ACTIONS_ARGS;
96 #if OPT_LOAD_VTFONTS || OPT_WIDE_CHARS
97 extern Bool xtermLoadWideFonts (XtermWidget /* w */, Bool /* nullOk */);
100 #define xtermIsDecGraphic(ch) ((ch) > 0 && (ch) < 32)
103 extern Bool xtermXftMissing (XtermWidget /* xw */, XftFont * /* font */, unsigned /* wc */);
104 extern void xtermCloseXft(TScreen * /* screen */, XTermXftFonts * /* pub */);
108 extern String getFaceName(XtermWidget /* xw */, Bool /* wideName */);
109 extern void HandleLargerFont PROTO_XT_ACTIONS_ARGS;
110 extern void HandleSmallerFont PROTO_XT_ACTIONS_ARGS;
111 extern void setFaceName(XtermWidget /* xw */, const char * /*value */);
115 extern unsigned ucs2dec (unsigned);
116 extern unsigned dec2ucs (unsigned);
119 #endif /* included_fontutils_h */