summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authordas <das>2006-03-22 00:21:15 (GMT)
committerdas <das>2006-03-22 00:21:15 (GMT)
commit2579527c4a82ca0cea032dfa5e9ed757f43cd59e (patch)
treefedd23bf410c6a013f190bd8aa27dbf9999214f1 /win
parenta035d9f0c9008fbb62a43d011474036c0c56ed3c (diff)
downloadtk-2579527c4a82ca0cea032dfa5e9ed757f43cd59e.zip
tk-2579527c4a82ca0cea032dfa5e9ed757f43cd59e.tar.gz
tk-2579527c4a82ca0cea032dfa5e9ed757f43cd59e.tar.bz2
* generic/tkFont.c: implementation of ATSUI text rendering
* generic/tkInt.h: in TkAqua provided by Benjamin * generic/tkTextDisp.c: Riefenstahl. [Patch 638966] * library/demos/unicodeout.tcl: * macosx/tkMacOSXFont.h (new file): * macosx/tkMacOSXFont.c: * tests/font.test: * unix/tkUnixFont.c: * win/tkWinFont.c: * generic/tkFont.c: moved MODULE_SCOPE declarations of * generic/tkFont.h: font helper procs into header files. * macosx/tkMacOSXButton.c: * macosx/tkMacOSXFont.h: * macosx/tkMacOSXMenubutton.c: * macosx/Wish.xcode/project.pbxproj: add new tkMacOSXFont.h file, * macosx/Wish.xcodeproj/project.pbxproj: turn off dead code stripping as it interferes with -sectcreate (rdar://4486223). * macosx/Wish.xcode/default.pbxuser: add TCLLIBPATH=/Library/Tcl * macosx/Wish.xcodeproj/default.pbxuser: env var setting to tktest. * unix/configure.in: fix detection of symbols build when enabling TkAqua debug code; filter nm output of libtclstub better to avoid error on intel macs [Bug 1415789]. * unix/configure: autoconf-2.59
Diffstat (limited to 'win')
-rw-r--r--win/tkWinFont.c104
1 files changed, 103 insertions, 1 deletions
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index 35619c7..bddaed9 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinFont.c,v 1.26 2005/12/02 00:19:04 dkf Exp $
+ * RCS: @(#) $Id: tkWinFont.c,v 1.27 2006/03/22 00:21:20 das Exp $
*/
#include "tkWinInt.h"
@@ -787,6 +787,64 @@ Tk_MeasureChars(
/*
*---------------------------------------------------------------------------
*
+ * TkpMeasureCharsInContext --
+ *
+ * Determine the number of bytes from the string that will fit in the
+ * given horizontal span. The measurement is done under the assumption
+ * that TkpDrawCharsInContext() will be used to actually display the
+ * characters.
+ *
+ * This one is almost the same as Tk_MeasureChars(), but with access to
+ * all the characters on the line for context. On Windows this context
+ * isn't consulted, so we just call Tk_MeasureChars().
+ *
+ * Results:
+ * The return value is the number of bytes from source that
+ * fit into the span that extends from 0 to maxLength. *lengthPtr is
+ * filled with the x-coordinate of the right edge of the last
+ * character that did fit.
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+int
+TkpMeasureCharsInContext(
+ Tk_Font tkfont, /* Font in which characters will be drawn. */
+ CONST char * source, /* UTF-8 string to be displayed. Need not be
+ * '\0' terminated. */
+ int numBytes, /* Maximum number of bytes to consider from
+ * source string in all. */
+ int rangeStart, /* Index of first byte to measure. */
+ int rangeLength, /* Length of range to measure in bytes. */
+ int maxLength, /* If >= 0, maxLength specifies the longest
+ * permissible line length; don't consider any
+ * character that would cross this x-position.
+ * If < 0, then line length is unbounded and the
+ * flags argument is ignored. */
+ int flags, /* Various flag bits OR-ed together:
+ * TK_PARTIAL_OK means include the last char
+ * which only partially fit on this line.
+ * TK_WHOLE_WORDS means stop on a word boundary,
+ * if possible. TK_AT_LEAST_ONE means return at
+ * least one character even if no characters fit.
+ * TK_ISOLATE_END means that the last character
+ * should not be considered in context with the
+ * rest of the string (used for breaking
+ * lines). */
+ int * lengthPtr) /* Filled with x-location just after the
+ * terminating character. */
+{
+ (void) numBytes; /*unused*/
+ return Tk_MeasureChars(tkfont, source + rangeStart, rangeLength,
+ maxLength, flags, lengthPtr);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
* Tk_DrawChars --
*
* Draw a string of characters on the screen.
@@ -947,6 +1005,50 @@ Tk_DrawChars(
}
/*
+ *---------------------------------------------------------------------------
+ *
+ * TkpDrawCharsInContext --
+ *
+ * Draw a string of characters on the screen like Tk_DrawChars(), but
+ * with access to all the characters on the line for context. On
+ * Windows this context isn't consulted, so we just call Tk_DrawChars().
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Information gets drawn on the screen.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+void
+TkpDrawCharsInContext(
+ Display * display, /* Display on which to draw. */
+ Drawable drawable, /* Window or pixmap in which to draw. */
+ GC gc, /* Graphics context for drawing characters. */
+ Tk_Font tkfont, /* Font in which characters will be drawn; must
+ * be the same as font used in GC. */
+ CONST char * source, /* UTF-8 string to be displayed. Need not be
+ * '\0' terminated. All Tk meta-characters
+ * (tabs, control characters, and newlines)
+ * should be stripped out of the string that is
+ * passed to this function. If they are not
+ * stripped out, they will be displayed as
+ * regular printing characters. */
+ int numBytes, /* Number of bytes in string. */
+ int rangeStart, /* Index of first byte to draw. */
+ int rangeLength, /* Length of range to draw in bytes. */
+ int x, int y) /* Coordinates at which to place origin of the
+ * whole (not just the range) string when
+ * drawing. */
+{
+ (void) numBytes; /*unused*/
+ Tk_DrawChars(display, drawable, gc, tkfont,
+ source + rangeStart, rangeLength, x, y);
+}
+
+/*
*-------------------------------------------------------------------------
*
* MultiFontTextOut --