Menu

#1682 Font ascent issue on wx platform

Bug
closed-fixed
3
2015-05-12
2015-01-10
No

The copy constructor of FontAlias does not copy Font::ascent member. Patch attached.

1 Attachments

Discussion

  • Neil Hodgson

    Neil Hodgson - 2015-01-10
    • labels: --> scintilla, wxwidgets
    • assigned_to: Neil Hodgson
    • Priority: 5 --> 3
     
  • Neil Hodgson

    Neil Hodgson - 2015-01-10

    Under what circumstances is this change needed? The issues with ascent on wxWidgets were addressed in [bugs:#1154].

     

    Related

    Bugs: #1154

  • ARATA Mizuki

    ARATA Mizuki - 2015-01-11

    Indeed, the situation on wxWidgets had been OK before revision 5151, but the change in revision 5151 [16c0de] seems to have broken it.

    So the proposed patch.

     

    Related

    Commit: [16c0de]

  • Neil Hodgson

    Neil Hodgson - 2015-01-11

    The presence of wxWidgets-specific code in the (supposedly) cross-platform parts of Scintilla has been an ongoing maintenance problem. This could be solved properly by removing the ascent member of Font and bundling it with the font inside the wxWidgets platform code. Other platforms also have extra data associated with each font but they have not exposed this outside the platform layers.

    To do this, create a two member struct or class (call it XFont for now) that contains both the wxWidgets font pointer and the ascent. Then when Font::Create is called, an XFont is allocated and a pointer to it is used for Font::fid. When Font::Release is called, the XFont is deleted and its destructor deletes the platform font. Each method that takes a Font (such as Surface::WidthText) then has to unwrap the XFont to reach the platform font and ascent (when needed).

    All of this can be implemented completely within the Scintilla platform layer for wxWidgets with no changes needed to the standard Scintilla distribution. Once the changes have been made and have been successful, then ascent can be removed from Font in the Scintilla distribution.

     
  • ARATA Mizuki

    ARATA Mizuki - 2015-01-12

    OK, I think I've managed to get rid of wxWidgets-specific code from Scintilla.

    If this patch (attached to wxWidgets Trac ticket) is accepted into wxWidgets, the wx-specific code in Scintilla can be removed.

     
    • Neil Hodgson

      Neil Hodgson - 2015-01-12

      That looks good.

       
  • Neil Hodgson

    Neil Hodgson - 2015-02-06

    Are there any problems with this change? I would like to remove the wx-specific code from Scintilla soon.

     
  • Neil Hodgson

    Neil Hodgson - 2015-03-28

    The wxWidgets-specific code has now been removed from Scintilla with change set [dbe7a5].

    This means that wxStyledTextCtrl will have to be altered to avoid use of Font::ascent.

     

    Related

    Commit: [dbe7a5]

  • Neil Hodgson

    Neil Hodgson - 2015-03-28
    • status: open --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2015-03-29

    The wxWidgets repository has been updated to be compatible with this change.

     
  • Neil Hodgson

    Neil Hodgson - 2015-05-12
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB