Revision: 16595
          http://sourceforge.net/p/skim-app/code/16595
Author:   hofman
Date:     2026-10-03 17:26:16 +0000 (Sat, 03 Oct 2026)
Log Message:
-----------
use calibrated RGB or white colorspace for fontColor in FDF, as that is what 
PDFAnnotation does for the /DA value

Modified Paths:
--------------
    trunk/PDFAnnotation_SKExtensions.m

Modified: trunk/PDFAnnotation_SKExtensions.m
===================================================================
--- trunk/PDFAnnotation_SKExtensions.m  2026-10-03 17:14:18 UTC (rev 16594)
+++ trunk/PDFAnnotation_SKExtensions.m  2026-10-03 17:26:16 UTC (rev 16595)
@@ -477,9 +477,15 @@
         }
     }
     if ([type isEqualToString:SKNFreeTextString]) {
-        [[[self fontColor] colorUsingColorSpaceName:NSDeviceRGBColorSpace] 
getRed:&r green:&g blue:&b alpha:&a];
         [fdfString appendFDFName:SKFDFDefaultAppearanceKey];
-        [fdfString appendFormat:@"(/%@ %g Tf %g %g %g rg)", [self fontName], 
[self fontSize], r, g, b];
+        NSColor *color = [self fontColor];
+        if ([[color colorSpace] colorSpaceModel] == NSGrayColorSpaceModel) {
+            [[color colorUsingColorSpaceName:NSCalibratedWhiteColorSpace] 
getWhite:&g alpha:&a];
+            [fdfString appendFormat:@"(/%@ %g Tf %g g)", [self fontName], 
[self fontSize], g];
+        } else {
+            [[color colorUsingColorSpaceName:NSCalibratedRGBColorSpace] 
getRed:&r green:&g blue:&b alpha:&a];
+            [fdfString appendFormat:@"(/%@ %g Tf %g %g %g rg)", [self 
fontName], [self fontSize], r, g, b];
+        }
         [fdfString appendFDFName:SKFDFAnnotationAlignmentKey];
         [fdfString appendFormat:@" %ld", 
(long)SKFDFFreeTextAnnotationAlignmentFromPDFFreeTextAnnotationAlignment([self 
alignment])];
     } else if ([type isEqualToString:SKNHighlightString] || [type 
isEqualToString:SKNUnderlineString] || [type 
isEqualToString:SKNStrikeOutString]) {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to