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

Italics does not render in Firemonkey when SKIA is enabled on Apple platforms iOS and MACOS #322

Open
jareddavison opened this issue Jun 24, 2024 · 10 comments

Comments

@jareddavison
Copy link

Italics do not render in Firemonkey app when SKIA is enabled on Apple platforms iOS and MACOS

I've logged this issue also with Embarcardero as RSS-1231

@viniciusfbb
Copy link
Member

@jareddavison I suspect that the limitation is related only to Oblique font slant, not Italic. I am now without my mac to test it. Can you test it?
You can edit the .fmx file directly in the notepad. The follow line is for FontSlant=Italic:

Font.StyleExt = {02040000000100000004000000}

The follow line is for FontSlant=Oblique:

Font.StyleExt = {02040000000200000004000000}

Off-topic: Just to who it may interest, I also made a tool to convert font weight, slant and stretch to TFontStyleExt and vice-versa as you cannot choose it using the IDE UI on the previous versions of RAD Studio:
Font.StyleExt.zip

@jareddavison
Copy link
Author

Thank you @viniciusfbb . that's interesting but I don't really understand the implication. Is this a style mapping issue?

See the design time (Windows) and runtime (MacOS) versions of the form:

FontExtStyle

Updated project files:
SkiaItalicsTest2.zip

@jareddavison
Copy link
Author

For interest's sake I thought I'd also show there is a slight difference between the design time and runtime on windows. I suspect this is because design time is not using SKIA where runtime is, am I right?
FontExtStyle-Windows-SKIA

@viniciusfbb
Copy link
Member

@jareddavison I don't know exactly the reason for this yet, and I really want to investigate more about this first. However, now we already have a possible workaround:

SkFontSlant : array[TFontSlant] of TSkFontSlant = (TSkFontSlant.Upright, TSkFontSlant.Italic, TSkFontSlant.Oblique);

to:

  SkFontSlant : array[TFontSlant] of TSkFontSlant = (TSkFontSlant.Upright, TSkFontSlant.Italic, {$IFDEF MACOS}TSkFontSlant.Italic{$ELSE}TSkFontSlant.Oblique{$ENDIF});

@viniciusfbb
Copy link
Member

I suspect this is because design time is not using SKIA where runtime is, am I right?

Yes. Design-time does not use skia because the GlobalUseSkia is False by default and your application change it only in runtime.

@jareddavison
Copy link
Author

jareddavison commented Jun 30, 2024

Here's the results of the patch on MacOS.
FontExtStyle-MacOS-SKIA-patched

@jareddavison
Copy link
Author

Also, here's the results for iPhone simulator:
FontExtStyle-iOS-Simulator-SKIA-patched

viniciusfbb added a commit that referenced this issue Jul 8, 2024
Co-Authored-By: Paulo César Botelho Barbosa <16469061 [email protected]>

#322
@viniciusfbb viniciusfbb self-assigned this Jul 8, 2024
@viniciusfbb viniciusfbb added this to vNext Jul 8, 2024
@viniciusfbb viniciusfbb added this to the vNext milestone Jul 8, 2024
@viniciusfbb viniciusfbb moved this to Done in vNext Jul 8, 2024
@viniciusfbb
Copy link
Member

@jareddavison The user Hans Jakobsen said on RSS-1231 that Italic Bold does not work. Can you confirm if that workaround works for italic bold also?

@jareddavison
Copy link
Author

jareddavison commented Jul 14, 2024

@viniciusfbb, I couldn't reproduce it as reported by Hans Jakobsen. See image below. Using the unpatched FMX.Skia.Canvas, bold does appear bold, but Italics was broken.

image

@viniciusfbb
Copy link
Member

@jareddavison Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants