[webkit-changes] cvs commit: WebCore/kwq KWQFont.mm

Darin darin at opensource.apple.com
Sun Aug 14 21:36:52 PDT 2005


darin       05/08/14 21:36:51

  Modified:    .        ChangeLog
               kwq      KWQFont.mm
  Log:
          Reviewed by Maciej.
  
          - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4422
            QFont has mistake where it caches computed pitch value incorrectly
  
          * kwq/KWQFont.mm:
          (QFont::setFamily): Set _pitch to Unknown when setting _NSFont to nil.
          (QFont::setFirstFamily): Ditto.
          (QFont::setPixelSize): Ditto. Might be unneeded; it would be bad to have the same font
          with different pitch settings at different sizes. But better to be safe.
          (QFont::setWeight): Ditto. Same caveat.
          (QFont::setItalic): Ditto. Ditto.
  
  Revision  Changes    Path
  1.4575    +15 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4574
  retrieving revision 1.4575
  diff -u -r1.4574 -r1.4575
  --- ChangeLog	15 Aug 2005 04:30:54 -0000	1.4574
  +++ ChangeLog	15 Aug 2005 04:36:47 -0000	1.4575
  @@ -1,3 +1,18 @@
  +2005-08-14  Darin Adler  <darin at apple.com>
  +
  +        Reviewed by Maciej.
  +
  +        - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4422
  +          QFont has mistake where it caches computed pitch value incorrectly
  +
  +        * kwq/KWQFont.mm:
  +        (QFont::setFamily): Set _pitch to Unknown when setting _NSFont to nil.
  +        (QFont::setFirstFamily): Ditto.
  +        (QFont::setPixelSize): Ditto. Might be unneeded; it would be bad to have the same font
  +        with different pitch settings at different sizes. But better to be safe.
  +        (QFont::setWeight): Ditto. Same caveat.
  +        (QFont::setItalic): Ditto. Ditto.
  +
   2005-08-14  Oliver Hunt  <ojh16 at student.canterbury.ac.nz>
   
           Reviewed and landed by Darin.
  
  
  
  1.47      +8 -1      WebCore/kwq/KWQFont.mm
  
  Index: KWQFont.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQFont.mm,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- KWQFont.mm	9 Jul 2005 20:19:25 -0000	1.46
  +++ KWQFont.mm	15 Aug 2005 04:36:51 -0000	1.47
  @@ -77,6 +77,7 @@
       _family.setFamily(qfamilyName);
       KWQRelease(_NSFont);
       _NSFont = 0;
  +    _pitch = Unknown;
   }
   
   void QFont::setFirstFamily(const KWQFontFamily& family) 
  @@ -84,6 +85,7 @@
       _family = family;
       KWQRelease(_NSFont);
       _NSFont = 0;
  +    _pitch = Unknown;
   }
   
   void QFont::setPixelSize(float s)
  @@ -91,6 +93,7 @@
       if (_size != s) {
           KWQRelease(_NSFont); 
           _NSFont = 0;
  +        _pitch = Unknown;
       }
       _size = s;
   }
  @@ -101,12 +104,14 @@
           if (!(_trait & NSBoldFontMask)){
               KWQRelease(_NSFont);
               _NSFont = 0;
  +            _pitch = Unknown;
           }
           _trait |= NSBoldFontMask;
       } else if (weight == Normal) {
           if ((_trait & NSBoldFontMask)){
               KWQRelease(_NSFont);
               _NSFont = 0;
  +            _pitch = Unknown;
           }
           _trait &= ~NSBoldFontMask;
       }
  @@ -128,12 +133,14 @@
           if (!(_trait & NSItalicFontMask)){
               KWQRelease(_NSFont);
               _NSFont = 0;
  +            _pitch = Unknown;
           }
           _trait |= NSItalicFontMask;
       } else {
           if ((_trait & NSItalicFontMask)){
               KWQRelease(_NSFont);
               _NSFont = 0;
  +            _pitch = Unknown;
           }
           _trait &= ~NSItalicFontMask;
       }
  @@ -152,7 +159,7 @@
   void QFont::determinePitch() const
   {
       KWQ_BLOCK_EXCEPTIONS;
  -    if ([[WebCoreTextRendererFactory sharedFactory] isFontFixedPitch: getNSFont()])
  +    if ([[WebCoreTextRendererFactory sharedFactory] isFontFixedPitch:getNSFont()])
           _pitch = Fixed;
       else
           _pitch = Variable;
  
  
  



More information about the webkit-changes mailing list