MCPcopy Create free account
hub / github.com/NetHack/NetHack / nhFontHeight

Function nhFontHeight

win/X11/winX.c:749–773  ·  view source on GitHub ↗

[ALI] Utility function to ask Xaw for font height, since the previous * assumption of ascent + descent is not always valid. */

Source from the content-addressed store, hash-verified

747 * assumption of ascent + descent is not always valid.
748 */
749Dimension
750nhFontHeight(Widget w)
751{
752#ifdef _XawTextSink_h
753 Widget sink;
754 XawTextPosition pos = 0;
755 int resWidth, resHeight;
756 Arg args[1];
757
758 XtSetArg(args[0], XtNtextSink, &sink);
759 XtGetValues(w, args, 1);
760
761 XawTextSinkFindPosition(sink, pos, 0, 0, 0, &pos, &resWidth, &resHeight);
762 return resHeight;
763#else
764 XFontStruct *fs;
765 Arg args[1];
766
767 XtSetArg(args[0], XtNfont, &fs);
768 XtGetValues(w, args, 1);
769
770 /* Assume font height is ascent + descent. */
771 return = fs->ascent + fs->descent;
772#endif
773}
774
775static String *default_resource_data = 0, /* NULL-terminated arrays */
776 *def_rsrc_macr = 0, /* macro names */

Callers 2

display_text_windowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected