summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-03-16 20:03:37 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-03-16 20:03:37 (GMT)
commitc5b9cd53fd9e807f139d017cfebc0a220a1a52d6 (patch)
tree7919dde9fd2b075d79539fdebb07129f0873e72c /macosx
parent5c8108b53d8b7c0911d0328b575df59fdc8fe33f (diff)
parentb0966ec52b2a3554f8285dd944844c78a4e6348f (diff)
downloadtk-c5b9cd53fd9e807f139d017cfebc0a220a1a52d6.zip
tk-c5b9cd53fd9e807f139d017cfebc0a220a1a52d6.tar.gz
tk-c5b9cd53fd9e807f139d017cfebc0a220a1a52d6.tar.bz2
Merge 8.6
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXFont.c66
1 files changed, 32 insertions, 34 deletions
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c
index e39d7c0..f9cd9bc 100644
--- a/macosx/tkMacOSXFont.c
+++ b/macosx/tkMacOSXFont.c
@@ -171,10 +171,8 @@ static int CreateNamedSystemFont(Tcl_Interp *interp,
return _ds;
}
-#ifndef __clang__
@synthesize UTF8String = _UTF8String;
@synthesize DString = _ds;
-#endif
@end
#define GetNSFontTraitsFromTkFontAttributes(faPtr) \
@@ -907,7 +905,7 @@ void
TkpGetFontAttrsForChar(
TCL_UNUSED(Tk_Window), /* Window on the font's display */
Tk_Font tkfont, /* Font to query */
- int c, /* Character of interest */
+ int c, /* Character of interest */
TkFontAttributes* faPtr) /* Output: Font attributes */
{
MacFont *fontPtr = (MacFont *) tkfont;
@@ -1084,9 +1082,9 @@ TkpMeasureCharsInContext(
double maxWidth = maxLength + offset;
NSCharacterSet *cs;
- /*
- * Get a line breakpoint in the source string.
- */
+ /*
+ * Get a line breakpoint in the source string.
+ */
index = start;
if (flags & TK_WHOLE_WORDS) {
@@ -1099,9 +1097,9 @@ TkpMeasureCharsInContext(
index = CTTypesetterSuggestClusterBreak(typesetter, start, maxWidth);
}
- /*
- * Trim right whitespace/lineending characters.
- */
+ /*
+ * Trim right whitespace/lineending characters.
+ */
cs = (index <= len && (flags & TK_WHOLE_WORDS)) ?
whitespaceCharacterSet : lineendingCharacterSet;
@@ -1110,29 +1108,29 @@ TkpMeasureCharsInContext(
index--;
}
- /*
- * If there is no line breakpoint in the source string between its
- * start and the index position that fits in maxWidth, then
- * CTTypesetterSuggestLineBreak() returns that very last index.
- * However if the TK_WHOLE_WORDS flag is set, we want to break at a
- * word boundary. In this situation, unless TK_AT_LEAST_ONE is set, we
- * must report that zero chars actually fit (in other words the
- * smallest word of the source string is still larger than maxWidth).
- */
-
- if ((index >= start) && (index < len) &&
- (flags & TK_WHOLE_WORDS) && !(flags & TK_AT_LEAST_ONE) &&
- ![cs characterIsMember:[string characterAtIndex:index]]) {
- index = start;
- }
+ /*
+ * If there is no line breakpoint in the source string between its
+ * start and the index position that fits in maxWidth, then
+ * CTTypesetterSuggestLineBreak() returns that very last index.
+ * However if the TK_WHOLE_WORDS flag is set, we want to break at a
+ * word boundary. In this situation, unless TK_AT_LEAST_ONE is set, we
+ * must report that zero chars actually fit (in other words the
+ * smallest word of the source string is still larger than maxWidth).
+ */
+
+ if ((index >= start) && (index < len) &&
+ (flags & TK_WHOLE_WORDS) && !(flags & TK_AT_LEAST_ONE) &&
+ ![cs characterIsMember:[string characterAtIndex:index]]) {
+ index = start;
+ }
if (index <= start && (flags & TK_AT_LEAST_ONE)) {
index = start + 1;
}
- /*
- * Now measure the string width in pixels.
- */
+ /*
+ * Now measure the string width in pixels.
+ */
if (index > 0) {
range.length = index;
@@ -1149,7 +1147,7 @@ TkpMeasureCharsInContext(
CFRelease(line);
}
- /*
+ /*
* The call to CTTypesetterSuggestClusterBreak above will always return
* at least one character regardless of whether it exceeded it or not.
* Clean that up now.
@@ -1330,9 +1328,9 @@ TkpDrawAngledCharsInContext(
CGAffineTransform t;
CGFloat width, height, textX = (CGFloat) x, textY = (CGFloat) y;
- if (rangeStart < 0 || rangeLength <= 0 ||
- rangeStart + rangeLength > numBytes ||
- !TkMacOSXSetupDrawingContext(drawable, gc, &drawingContext)) {
+ if (rangeStart < 0 || rangeLength <= 0
+ || rangeStart + rangeLength > numBytes
+ || !TkMacOSXSetupDrawingContext(drawable, gc, &drawingContext)) {
return;
}
string = [[TKNSString alloc] initWithTclUtfBytes:source length:numBytes];
@@ -1362,9 +1360,9 @@ TkpDrawAngledCharsInContext(
t = CGAffineTransformMake(1.0, 0.0, 0.0, -1.0, 0.0, height);
if (angle != 0.0) {
t = CGAffineTransformTranslate(
- CGAffineTransformRotate(
- CGAffineTransformTranslate(t, textX, textY), angle*PI/180.0),
- -textX, -textY);
+ CGAffineTransformRotate(
+ CGAffineTransformTranslate(t, textX, textY), angle*PI/180.0),
+ -textX, -textY);
}
CGContextConcatCTM(context, t);
start = Tcl_NumUtfChars(source, rangeStart);