summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixFont.c
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2006-12-01 20:14:22 (GMT)
committerKevin B Kenny <kennykb@acm.org>2006-12-01 20:14:22 (GMT)
commitf3c61f906644a08ee6b019c51e6e1d7c67bab6b7 (patch)
tree489ea29c16233aae8944a6e2c553d6f40503fc20 /unix/tkUnixFont.c
parent516e0720f0996e0e74a8af1e9c9ab7a58fa00451 (diff)
downloadtk-f3c61f906644a08ee6b019c51e6e1d7c67bab6b7.zip
tk-f3c61f906644a08ee6b019c51e6e1d7c67bab6b7.tar.gz
tk-f3c61f906644a08ee6b019c51e6e1d7c67bab6b7.tar.bz2
TIP 300 IMPLEMENTATION
Diffstat (limited to 'unix/tkUnixFont.c')
-rw-r--r--unix/tkUnixFont.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c
index 9174f8e..0ab8fb5 100644
--- a/unix/tkUnixFont.c
+++ b/unix/tkUnixFont.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixFont.c,v 1.29 2006/10/05 21:27:43 hobbs Exp $
+ * RCS: @(#) $Id: tkUnixFont.c,v 1.30 2006/12/01 20:14:23 kennykb Exp $
*/
#include "tkUnixInt.h"
@@ -930,6 +930,44 @@ TkpGetSubFonts(
}
/*
+ *----------------------------------------------------------------------
+ *
+ * TkpGetFontAttrsForChar --
+ *
+ * Retrieve the font attributes of the actual font used to render
+ * a given character.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The font attributes are stored in *faPtr.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpGetFontAttrsForChar(
+ Tk_Window tkwin, /* Window on the font's display */
+ Tk_Font tkfont, /* Font to query */
+ Tcl_UniChar c, /* Character of interest */
+ TkFontAttributes* faPtr) /* Output: Font attributes */
+{
+ FontAttributes atts;
+ UnixFont *fontPtr = (UnixFont *) tkfont;
+ /* Structure describing the logical font */
+ SubFont *lastSubFontPtr = &fontPtr->subFontArray[0];
+ /* Pointer to subfont array in case
+ * FindSubFontForChar needs to fix up the
+ * memory allocation */
+ SubFont *thisSubFontPtr = FindSubFontForChar(fontPtr, c, &lastSubFontPtr);
+ /* Pointer to the subfont to use for the
+ * given character */
+ GetFontAttributes(Tk_Display(tkwin), thisSubFontPtr->fontStructPtr, &atts);
+ *faPtr = atts.fa;
+}
+
+/*
*---------------------------------------------------------------------------
*
* Tk_MeasureChars --