-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Faux italic and bold in build preview and pdf build on some(?) Linux distributions #2110
Comments
It just occured to me that the novelWriter UI on KDE neon probably also uses faux bold. I've never noticed because there is nothing italic, which is more easily distinguishable than bold, in the UI. Can verify that by activating "Emphasize partition and chapter labels", and selecting a large font, e.g. "48pt Noto Serif Regular". Faux bold simply doesn't get applied at all at larger font sizes. |
The editor uses true italic and true bold. The document viewer uses faux. 🙈 |
I'll look into whether I need to manually change font styles. The viewer/preview/pdf all uses the ToQTextDocument class in the formats folder, and it changes between styles by setting the bold/italic/underline flags. That may not be sufficient? I will investigate. Seems like there will be a 2.6 Beta 2 release before the RC 1 anyway, as I've spent the last week completely rewriting the project tree and how it is loaded and handled at runtime. This definitely needs testing in the wild before release. The new implementation should be more robust though, but there may be interaction bugs with the UI. |
Just dropping by to say that maybe one of these will give some clues.
|
Hmm. these issues may actually be KDE-specific. See comments in QTBUG-75027. See also QTBUG-63792. I think the problem arose when I added the option to allow selecting font style in novelWriter from #1733. As far as I can tell from the Qt docs, when I call I'm removing those modifications and instead saving the default style of the selected font, and reverting to that when the bold, italic, underline, etc, styles in the text are reset to normal. This seems to work as expected for thin fonts in the preview, but testing on ODT output, I think LibreOffice uses fixed weights for normal and bold (i.e. 400 and 700), so relative weight may be needed. At least LibreOffice shows bolder bold for extra thin than manuscript preview does. |
Ok, looking into how LibreOffice handles bold/italic/etc with non-regular fonts, it simply uses the default bold and italic flags, like here for Raleway ExtraLight. No need for the specific font weight numerical values. <office:automatic-styles>
<style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard">
<style:text-properties style:font-name="Raleway ExtraLight" officeooo:rsid="0009fcb5" officeooo:paragraph-rsid="0009fcb5"/>
</style:style>
<style:style style:name="T1" style:family="text">
<style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
</style:style>
<style:style style:name="T2" style:family="text">
<style:text-properties fo:font-weight="normal" style:font-weight-asian="normal" style:font-weight-complex="normal"/>
</style:style>
<style:style style:name="T3" style:family="text">
<style:text-properties fo:font-style="italic" fo:font-weight="normal" style:font-style-asian="italic" style:font-weight-asian="normal" style:font-style-complex="italic" style:font-weight-complex="normal"/>
</style:style>
<style:style style:name="T4" style:family="text">
<style:text-properties fo:font-style="normal" fo:font-weight="normal" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-style-complex="normal" style:font-weight-complex="normal"/>
</style:style>
<style:style style:name="T5" style:family="text">
<style:text-properties fo:font-style="normal" style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color" fo:font-weight="normal" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-style-complex="normal" style:font-weight-complex="normal"/>
</style:style>
<style:style style:name="T6" style:family="text">
<style:text-properties fo:font-style="normal" style:text-underline-style="none" fo:font-weight="normal" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-style-complex="normal" style:font-weight-complex="normal"/>
</style:style>
</office:automatic-styles> |
With the changes made in #2122 that ensures standard font emphasis is used, I don't think there's more I can do on this. The KDE-specific issues seem to be Qt-related, and nothing to do with novelWriter. Let's see how this goes when we move to Qt6. |
This is for 2.6 Beta 1 but it probably applies to older novelWriter versions too. I tested the AppImage and deb on Ubuntu, and the AppImage on KDE neon. I've used the freshest versions of Ubuntu and KDE neon, both fresh installs in a VM.
Works as expected on Ubuntu. I'm guessing it's the same as you're seeing on Debian.
But on KDE neon, the build preview and the pdf build use faux italic and faux bold. I don't quite understand why: If I select "Serif" in the font family dialog, it will select a standard serif font as specified by the operating system (is my guess). This will put "Noto Serif Regular" into the MBS and this will render true italic and true bold. But if I explicitly select the font "Noto Serif Regular", faux italic and faux bold are used. Any other explicitly set font will also use faux italic and faux bold.
The fonts are installed correctly, as selecting e.g. "Noto Serif Italic" will render the whole build preview and pdf build in true italic, as expected.
I hope that this makes sense to you and this can be fixed in the novelWriter code.
(True italics in most fonts can be easily seen in a more nicely shaped letter
f
. Faux bold either doubles-up the letters, which can be seen when zoomed in on the letteri
, or it puts a less noticeable outline around the letters.)(Issue discussed also in #2100)
The text was updated successfully, but these errors were encountered: