bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #30493] -[NSFont fontWithName:matrix:] does not match OSX when in a


From: Derek Fawcus
Subject: [bug #30493] -[NSFont fontWithName:matrix:] does not match OSX when in a flipped view
Date: Mon, 19 Jul 2010 23:20:26 +0000
User-agent: Firefox/3.6.3

URL:
  <http://savannah.gnu.org/bugs/?30493>

                 Summary: -[NSFont fontWithName:matrix:] does not match OSX
when in a flipped view
                 Project: GNUstep
            Submitted by: dfawcus
            Submitted on: Mon 19 Jul 2010 11:20:25 PM GMT
                Category: Gui/AppKit
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

The text in the description of the above method that "Fonts created with a
matrix other than NSFontIdentityMatrix don't  automatically flip themselves in
flipped views." is incorrect.

At least for the case of using a matrix like [X 0 S Y 0 0],  where S allows
for obliqing a roman font.

For OSX (10.6 anyway,  I'll check 10.4/10.5 later),  the font is
automatically flipped.  Similarly for OS4.2 the font is automatically flipped
if one prevents the use of screen fonts.

The fix is simple and obvious - removing the test on matrixExplicitlySet
within -[NSFont setInContext:].

@@ -990,8 +989,7 @@ static BOOL flip_hack;

 - (void) setInContext: (NSGraphicsContext*)context
 {
-  if (matrixExplicitlySet == NO
-    && ([[NSView focusView] isFlipped] || flip_hack))
+  if ([[NSView focusView] isFlipped] || flip_hack)
     [context GSSetFont: [[self _flippedViewFont] fontRef]];
   else
     [context GSSetFont: [self fontRef]];

However doing so renders that field more or less useless,  so it can probably
be eliminated.  It then also looks like this would also allow the third
argument of

- (id) initWithName: (NSString*)name
             matrix: (const CGFloat*)fontMatrix
                fix: (BOOL)explicitlySet
         screenFont: (BOOL)screenFont
               role: (int)role;

to be eliminated.

The above change allows the art backend to operate in the same fashion as
OSX.

However for the cairo backend,  while it now displays text upright,  the
effect of manually obliquing text is wrong - text that should lean to the
right ends up leaning to the left.





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?30493>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]