Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First part of font refactoring. These changes simplify a few things #2751

Merged
merged 1 commit into from Jul 3, 2014

Conversation

@glennw
Copy link
Member

glennw commented Jul 2, 2014

but don't do much on their own, they just make it easier to
implement the work to come (web fonts, performance improvments
in terms of font loading and memory usage).

  • Font identifier on Linux/Android is now the font file path.
    This is a temporary measure, but simplifies things a lot for now.
  • Remove FontListHandleMethods trait in favour of free functions.
  • FontList::refresh() has no knowledge of FontFamily etc. Instead it takes
    a closure that the caller provides.
  • FontList::load_variations_for_family no longer creates the font
    handle. Instead it takes a closure and provides the name of the font
    identifier for the variations it finds.
  • Remove path_from_identifier() - it's no longer required.
  • create_font_from_identifier() takes an Option<Style>, allowing it to be
    used to create fonts for family matching purposes where the font size is
    not important.

Tested on Linux + Mac. Builds on Android but not able to confirm it's working correctly.

but don't do much on their own, they just make it easier to
implement the work to come (web fonts, performance improvments
in terms of font loading and memory usage).

- Font identifier on Linux/Android is now the font file path.
  This is a temporary measure, but simplifies things a lot for now.
- Remove FontListHandleMethods trait in favour of free functions.
- FontList::refresh() has no knowledge of FontFamily etc. Instead it takes
  a closure that the caller provides.
- FontList::load_variations_for_family no longer creates the font
  handle. Instead it takes a closure and provides the name of the font
  identifier for the variations it finds.
- Remove path_from_identifier() - it's no longer required.
- create_font_from_identifier() takes an Option<Style>, allowing it to be
  used to create fonts for family matching purposes where the font size is
  not important.

Tested on Linux + Mac. Builds on Android but not able to confirm it's working correctly.
@hoppipolla-critic-bot
Copy link

hoppipolla-critic-bot commented Jul 2, 2014

Critic review: https://critic.hoppipolla.co.uk/r/1952

This is an external review system which you may optionally use for the code review of your pull request.

In order to help critic track your changes, please do not make in-place history rewrites (e.g. via git rebase -i or git commit --amend) when updating this pull request.

@highfive
Copy link

highfive commented Jul 2, 2014

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
@glennw
Copy link
Member Author

glennw commented Jul 2, 2014

@larsbergstrom

This comment has been minimized.

Copy link

larsbergstrom commented on 51bd334 Jul 3, 2014

r+

larsbergstrom added a commit that referenced this pull request Jul 3, 2014
First part of font refactoring. These changes simplify a few things
@larsbergstrom larsbergstrom merged commit b0ffeaf into servo:master Jul 3, 2014
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
@glennw glennw deleted the glennw:font-refactor-1 branch Jul 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.