Repository navigation
FOP-3356: simulate-style does not slant an italic face or stroke a bold one, and strokes at 1/35 em - #125
Open
plutext wants to merge 1 commit into
Open
FOP-3356: simulate-style does not slant an italic face or stroke a bold one, and strokes at 1/35 em#125plutext wants to merge 1 commit into
plutext wants to merge 1 commit into
Conversation
…ld one, and strokes at 1/35 em PDFPainter.startSimulateStyle synthesised a style from the font entry's simulate-style flag and the triplet alone: a bold triplet was stroked with a fixed 0.31543pt line and an italic one sheared by 0.3333, whatever the face. So an italic face registered for a bold italic triplet was slanted a second time, a bold face registered for a bold italic one was stroked again, and the stroke, right at about 11pt, was too light at larger sizes and too heavy at smaller ones. Now an italic triplet is sheared only where the face's italic angle is 0, and a bold one stroked only where the face's weight class is below 700 (an unknown weight counting as not bold, as before). The stroke is the font size / 35, which is what Word draws for a synthetic bold at every size; at 11.04pt it is the former 0.31543. Only the painted glyphs change, never layout. Tests: PDFPainterTestCase, an italic face not sheared, a bold face not stroked, the stroke at 22.08pt (0.63086); each fails before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes FOP-3356.
PDFPainter.startSimulateStylesynthesised a style from the font entry'ssimulate-styleflag and the tripletalone: a bold triplet was stroked with a fixed 0.31543pt line and an italic one sheared by 0.3333, whatever the
face. So an italic face registered for a bold italic triplet was slanted a second time, a bold face registered
for a bold italic one was stroked again, and the stroke, right at about 11pt, was too light at larger sizes and
too heavy at smaller ones.
The change. In
startSimulateStyleandendSimulateStyle, used by bothdrawTextWithDXanddrawTextWithDP:CustomFont.getItalicAngle(), from the posttable) is 0;
CustomFont.getWeight(), from OS/2) is below700; an unknown weight, 0, counts as not bold, as before;
is the former 0.31543.
Only the painted glyphs change, never layout.
Test.
PDFPainterTestCase: an italic face not sheared, a bold face not stroked, and the stroke at 22.08pt(0.63086); each fails without the change. The two existing simulate-style tests now run at 11.04pt, where the
stroke is the former constant. With the change, the fop-core suite passes, 3679 tests and 0 failures, and
checkstyle reports 0 violations.
🤖 Generated with Claude Code