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

Uppercase strings rather than chars for small-caps #25106

Closed
SimonSapin opened this issue May 4, 2015 · 3 comments
Closed

Uppercase strings rather than chars for small-caps #25106

SimonSapin opened this issue May 4, 2015 · 3 comments

Comments

@SimonSapin
Copy link
Contributor

Currently, font-variant: small-caps is implemented with synthesized small caps: transform the text to upper case and use a smaller font size. gfx::font::glyph_index contains code like codepoint.to_uppercase().next().unwrap() to find the upper case of a single code point. .next().unwrap() takes the first char in the iterator returned by char::to_uppercase and drops the rest.

This is OK at the moment since the iterator always of length 1. But in the future, it will do complex case mapping and may yield more than one char, and the rest should not be dropped. See #23126

The small-caps implementation should probably use str::to_uppercase earlier in the code, before considering individual chars.

@SimonSapin
Copy link
Contributor Author

I just realized it’s not as easy as upper-casing entire text nodes, we only want to reduce the font size of things that were previously lower-case.

@jdm
Copy link
Contributor

jdm commented May 4, 2015

@SimonSapin Wrong repo?

@SimonSapin
Copy link
Contributor Author

Oops! Yes, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants