Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upgfx: Implement `letter-spacing` per CSS 2.1 § 16.4. #4325
Conversation
hoppipolla-critic-bot
commented
Dec 11, 2014
|
Critic review: https://critic.hoppipolla.co.uk/r/3460 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 |
I’m not sure if this would work, but maybe you could have three files: one with "fi" (or some other ligature), one with "fi" that should be different from the first, and one with "fi" with letter spacing that should be like the latter? … reading the spec, that might be tricky since ligatures are disabled "When the effective spacing between two characters is not zero", not just when |
|
Yeah, I saw that language in the spec and disabled ligatures if letter-spacing was 0 as well. I'm a little wary of violating "should" in the spec just for tests, especially since we can test it another way (just with a fair amount of mucking around in FontForge). Furthermore, it's kind of hard to find a font that Servo will actually draw ligatures with right now. This is because of #4320 — we only support the newest of the new formats for ligatures, and most fonts use the old |
|
Alright, let’s not block this PR on this, we can refine later. |
cc414f0
to
fcf7819
|
r? @mbrubeck |
| if (*font_and_shaping_options).options.flags.contains(IGNORE_LIGATURES_SHAPING_FLAG) && | ||
| tag == GSUB { | ||
| debug!("ignoring ligatures, so ignoring `GSUB` table"); | ||
| return ptr::null_mut() |
This comment has been minimized.
This comment has been minimized.
mbrubeck
Dec 12, 2014
Contributor
Disabling the GSUB table seems like a very blunt instrument. Can we disable ligatures only, by setting the "liga" feature to 0 when we call hb_shape?
|
I changed it to use HarfBuzz features. re-r? @mbrubeck |
The ligature disabling code has been manually verified, but I was unable to reftest it. (The only way I could think of would be to create an Ahem-like font with a ligature table, but that would be an awful lot of work.) Near as I can tell, the method used to apply the spacing (manually inserting extra advance post-shaping) matches Gecko. r? @SimonSapin
|
This is definitely not something that should be retried blindly. Can we please be more careful about looking at test failure logs? |
The ligature disabling code has been manually verified, but I was unable to reftest it. (The only way I could think of would be to create an Ahem-like font with a ligature table, but that would be an awful lot of work.) Near as I can tell, the method used to apply the spacing (manually inserting extra advance post-shaping) matches Gecko. r? @SimonSapin
The ligature disabling code has been manually verified, but I was unable to reftest it. (The only way I could think of would be to create an Ahem-like font with a ligature table, but that would be an awful lot of work.) Near as I can tell, the method used to apply the spacing (manually inserting extra advance post-shaping) matches Gecko.
This comment has been minimized.
This comment has been minimized.
|
r=mbrubeck |
This comment has been minimized.
This comment has been minimized.
|
saw approval from mbrubeck |
This comment has been minimized.
This comment has been minimized.
|
merging pcwalton/servo/letter-spacing = 07bc97e into auto |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
all tests pass: |
This comment has been minimized.
This comment has been minimized.
|
fast-forwarding master to auto = 914f272 |
The ligature disabling code has been manually verified, but I was unable to reftest it. (The only way I could think of would be to create an Ahem-like font with a ligature table, but that would be an awful lot of work.) Near as I can tell, the method used to apply the spacing (manually inserting extra advance post-shaping) matches Gecko. r? @SimonSapin
07bc97e
into
servo:master
pcwalton commentedDec 11, 2014
The ligature disabling code has been manually verified, but I was unable
to reftest it. (The only way I could think of would be to create an
Ahem-like font with a ligature table, but that would be an awful lot of
work.)
Near as I can tell, the method used to apply the spacing (manually
inserting extra advance post-shaping) matches Gecko.
r? @SimonSapin