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