https://bugs.kde.org/show_bug.cgi?id=472791
Bug ID: 472791 Summary: Unable to pick correct pixel size of BDF bitmap font Classification: Applications Product: krita Version: git master (please specify the git hash!) Platform: Microsoft Windows OS: Microsoft Windows Status: REPORTED Severity: normal Priority: NOR Component: Tool/Text Assignee: krita-bugs-n...@kde.org Reporter: al...@alvinhc.com CC: griffinval...@gmail.com Target Milestone: --- SUMMARY Bitmap fonts in BDF format comes in separate files per font size. When using fontconfig to select font files in KoFontRegistry::facesForCSSValues, the code is unable to pick the correct font file for the specified font size. STEPS TO REPRODUCE 1. Install "WenQuanYi Bitmap Song" from https://sourceforge.net/projects/wqy/files/wqy-bitmapfont/1.0.0-RC1/ (on Windows, extract BDF files into `%LocalAppData%\Microsoft\Windows\Fonts`) 2. Create a file at 72 ppi, switch to 100% or 200% zoom 3. Create a text shape with the following SVG: ```svg <text style="fill:#000000; letter-spacing:0; font-family:WenQuanYi Bitmap Song; font-size:12; stroke-width:0"><tspan x="0">佔位文字 Testing </tspan><tspan x="0" dy="20" style="font-style:italic;">佔位文字 Testing</tspan></text> ``` 4. Save the text and observe the result 5. Change font-size to 16 6 Save the text and observe the result OBSERVED RESULT At font-size 12, the two lines of text incorrectly use different font sizes: first line uses 9pt (12px); second line uses 10pt (13px). At font-size 16, the two lines still use the same font size as before. EXPECTED RESULT Font-size 12 should be using 9pt (12px) `wenquanyi_9pt.bdf`. Font-size 16 should be using 12pt (16px) `wenquanyi_12pt.bdf`. SOFTWARE/OS VERSIONS Windows: 10 Base commit is 57d5a2c958 -- You are receiving this mail because: You are watching all bug changes.