Revision: 3858
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3858&view=rev
Author:   hofman
Date:     2008-05-06 15:23:18 -0700 (Tue, 06 May 2008)

Log Message:
-----------
Add font color to FDF string.

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

Modified: trunk/SKPDFAnnotationFreeText.m
===================================================================
--- trunk/SKPDFAnnotationFreeText.m     2008-05-06 22:08:52 UTC (rev 3857)
+++ trunk/SKPDFAnnotationFreeText.m     2008-05-06 22:23:18 UTC (rev 3858)
@@ -96,7 +96,7 @@
 - (NSDictionary *)properties{
     NSMutableDictionary *dict = [[[super properties] mutableCopy] autorelease];
     [dict setValue:[self font] forKey:SKPDFAnnotationFontKey];
-    if ([self respondsToSelector:@selector(fontColor)])
+    if ([self respondsToSelector:@selector(fontColor)] && [[self fontColor] 
isEqual:[NSColor colorWithCalibratedWhite:0.0 alpha:0.0]] == NO)
         [dict setValue:[self fontColor] forKey:SKPDFAnnotationFontColorKey];
     if ([self respondsToSelector:@selector(rotation)])
         [dict setValue:[NSNumber numberWithInt:[self rotation]] 
forKey:SKPDFAnnotationRotationKey];
@@ -106,7 +106,13 @@
 - (NSString *)fdfString {
     NSMutableString *fdfString = [[[super fdfString] mutableCopy] autorelease];
     [fdfString appendFDFName:SKFDFDefaultAppearanceKey];
-    [fdfString appendFormat:@"(/%@ %f Tf)", [[self font] fontName], [[self 
font] pointSize]];
+    [fdfString appendFormat:@"(/%@ %f Tf", [[self font] fontName], [[self 
font] pointSize]];
+    if ([self respondsToSelector:@selector(fontColor)] && [[self fontColor] 
isEqual:[NSColor colorWithCalibratedWhite:0.0 alpha:0.0]] == NO) {
+        float r = 0.0, g = 0.0, b = 0.0, a;
+        [[self fontColor] getRed:&r green:&g blue:&b alpha:&a];
+        [fdfString appendFormat:@" %f %f %f rg", r, g, b];
+    }
+    [fdfString appendString:@")"];
     [fdfString appendFDFName:SKFDFDefaultStyleKey];
     [fdfString appendFormat:@"(font: %@ %fpt)", [[self font] fontName], [[self 
font] pointSize]];
     return fdfString;


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

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to