Skip to content

Handle generic font-family names #8371

Closed

Description

@SimonSapin

https://drafts.csswg.org/css-fonts/#propdef-font-family
https://drafts.csswg.org/css-fonts/#generic-font-families

In the font-family property, the serif, sans-serif, cursive, fantasy, and monospace keywords represent generic families when they’re not in quotes.

  • Uncomment this code and this code in components/style/properties.mako.rs
  • Change get_initial_value() to return FontFamily::Serif
  • Handle the new variants in components/gfx/font_context.rs. (I have no idea what this involves.)

Activity

  1. SimonSapin commented on Nov 6, 2015

    @SimonSapin
    MemberAuthor

    See also occurrences of "generic" in components/gfx/font_cache_task. Since there is a fixed set of generic families, maybe the hash map in FontCache::generic_fonts should be replaced with a match expression on the style crate’s FontFamily enum.

  2. SimonSapin commented on Nov 6, 2015

    @SimonSapin
    MemberAuthor

    CC @Ms2ger @pcwalton @glennw for winning the git shortlog -sn components/gfx/font* lottery.

  3. added
    A-content/css
    on Nov 6, 2015
  4. craftytrickster commented on Nov 8, 2015

    @craftytrickster
    Contributor

    If possible, I would like to attempt this.

  5. added
    C-assigned
    on Nov 8, 2015
  6. eefriedman commented on Nov 8, 2015

    @eefriedman
    Contributor

    Okay; feel free to ask if you have any questions.

  7. craftytrickster commented on Nov 9, 2015

    @craftytrickster
    Contributor

    @eefriedman Thank you.
    @SimonSapin Thank you for the explanation of the issue. I have made some preliminary changes which I will put in a pull request.

    As for handling the variants in components/gfx/font_context.rs, I am not sure anything needs to be done there, since it is not directly interacting with the FontFamily enum.

    As for the modifying components/gfx/font_cache_task, I did replace the plain string instances with instances of the FontFamily enum, however, I did not remove the HashMap. My reasoning is because when transform_family is called, if we did not use the HashMap we would have to calculate the mapped family every time instead of doing it one time upfront during hashmap population.

  8. added a commit that references this issue on Dec 16, 2015
  9. added 2 commits that reference this issue on Dec 31, 2015
  10. 3 remaining items

  11. added 5 commits that reference this issue on Jul 5, 2024
    f3fda34
    e88249e
    ebf60c7
    50f2b0a
    1794a32
  12. added a commit that references this issue on Jul 8, 2024
    d8fb8e0
  13. added a commit that references this issue on Jul 8, 2024
    0afc3f9
  14. added a commit that references this issue on Jul 8, 2024
    04445c9
  15. added a commit that references this issue on Jul 8, 2024
    98383ce
  16. added 2 commits that reference this issue on Jul 8, 2024
    5904b64
    b4ee40e
  17. added a commit that references this issue on Jul 8, 2024
    77e9e3d
  18. added a commit that references this issue on Jul 22, 2024
    4ee3eec
  19. added a commit that references this issue on Jul 26, 2024
    4fa6601
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-content/cssA-platform/fontsC-assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions