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

iOS App: Custom Fonts in iOS 14 #472

Closed
smirta opened this issue Oct 29, 2020 · 24 comments
Closed

iOS App: Custom Fonts in iOS 14 #472

smirta opened this issue Oct 29, 2020 · 24 comments
Assignees
Labels
bug Something isn't working ios Specific to the Collabora Office iOS app, or to online accessed from i(Pad)OS devices

Comments

@smirta
Copy link

smirta commented Oct 29, 2020

Describe the bug
After the upgrade to iOS/iPadOS 14 custom fonts are no longer available in Collabora Office. As far as we understood new font handling was introduced with iOS 13 and the way it was done before is no longer possible in iOS/iPadOS 14.

See: https://developer.apple.com/documentation/ios-ipados-release-notes/ios-ipados-14-release-notes#Fonts

To Reproduce
Steps to reproduce the behavior:

  1. Open Collabora Office App
  2. Select custom font

Expected behavior
Font can be selected

Actual behavior
Font not available

Screenshots

iPad (please complete the following information)

  • OS: iOS
  • Version: 14.0.1

Additional context
https://developer.apple.com/documentation/ios-ipados-release-notes/ios-ipados-14-release-notes#Fonts

@smirta smirta added bug Something isn't working unconfirmed labels Oct 29, 2020
@mrkara mrkara added the ios Specific to the Collabora Office iOS app, or to online accessed from i(Pad)OS devices label Oct 29, 2020
@timar timar assigned tml1024 and unassigned thebearon Nov 4, 2020
@tml1024
Copy link
Contributor

tml1024 commented Nov 4, 2020

Could you be more specific and describe exactly what does not work? Do you mean that the fonts bundled with Collabora Office do not show up in its font selection controls? What is a "custom" font? What version of the app are you testing with, the latest one in the App Store "4.2.11-1" or the latest one available in TestFlight "6.4.0 (7)"?

(The fonts bundled with the app are: Alef-Bold.ttf Alef-Regular.ttf Amiri-Bold.ttf Amiri-BoldSlanted.ttf Amiri-Regular.ttf Amiri-Slanted.ttf AmiriQuran.ttf Caladea-Bold.ttf Caladea-BoldItalic.ttf Caladea-Italic.ttf Caladea-Regular.ttf Carlito-Bold.ttf Carlito-BoldItalic.ttf Carlito-Italic.ttf Carlito-Regular.ttf DavidCLM-Bold.ttf DavidCLM-BoldItalic.ttf DavidCLM-Medium.ttf DavidCLM-MediumItalic.ttf DavidLibre-Bold.ttf DavidLibre-Regular.ttf DejaVuMathTeXGyre.ttf DejaVuSans-Bold.ttf DejaVuSans-BoldOblique.ttf DejaVuSans-ExtraLight.ttf DejaVuSans-Oblique.ttf DejaVuSans.ttf DejaVuSansCondensed-Bold.ttf DejaVuSansCondensed-BoldOblique.ttf DejaVuSansCondensed-Oblique.ttf DejaVuSansCondensed.ttf DejaVuSansMono-Bold.ttf DejaVuSansMono-BoldOblique.ttf DejaVuSansMono-Oblique.ttf DejaVuSansMono.ttf DejaVuSerif-Bold.ttf DejaVuSerif-BoldItalic.ttf DejaVuSerif-Italic.ttf DejaVuSerif.ttf DejaVuSerifCondensed-Bold.ttf DejaVuSerifCondensed-BoldItalic.ttf DejaVuSerifCondensed-Italic.ttf DejaVuSerifCondensed.ttf EmojiOneColor-SVGinOT.ttf FrankRuehlCLM-Bold.ttf FrankRuehlCLM-BoldOblique.ttf FrankRuehlCLM-Medium.ttf FrankRuehlCLM-MediumOblique.ttf FrankRuhlHofshi-Bold.otf FrankRuhlHofshi-Regular.otf GenBasB.ttf GenBasBI.ttf GenBasI.ttf GenBasR.ttf GenBkBasB.ttf GenBkBasBI.ttf GenBkBasI.ttf GenBkBasR.ttf KacstBook.ttf KacstOffice.ttf LiberationMono-Bold.ttf LiberationMono-BoldItalic.ttf LiberationMono-Italic.ttf LiberationMono-Regular.ttf LiberationSans-Bold.ttf LiberationSans-BoldItalic.ttf LiberationSans-Italic.ttf LiberationSans-Regular.ttf LiberationSansNarrow-Bold.ttf LiberationSansNarrow-BoldItalic.ttf LiberationSansNarrow-Italic.ttf LiberationSansNarrow-Regular.ttf LiberationSerif-Bold.ttf LiberationSerif-BoldItalic.ttf LiberationSerif-Italic.ttf LiberationSerif-Regular.ttf LinBiolinum_RB_G.ttf LinBiolinum_RI_G.ttf LinBiolinum_R_G.ttf LinLibertine_DR_G.ttf LinLibertine_RBI_G.ttf LinLibertine_RB_G.ttf LinLibertine_RI_G.ttf LinLibertine_RZI_G.ttf LinLibertine_RZ_G.ttf LinLibertine_R_G.ttf MiriamCLM-Bold.ttf MiriamCLM-Book.ttf MiriamLibre-Bold.otf MiriamLibre-Regular.otf MiriamMonoCLM-Bold.ttf MiriamMonoCLM-BoldOblique.ttf MiriamMonoCLM-Book.ttf MiriamMonoCLM-BookOblique.ttf NachlieliCLM-Bold.otf NachlieliCLM-BoldOblique.otf NachlieliCLM-Light.otf NachlieliCLM-LightOblique.otf NotoKufiArabic-Bold.ttf NotoKufiArabic-Regular.ttf NotoMono-Regular.ttf NotoNaskhArabic-Bold.ttf NotoNaskhArabic-Regular.ttf NotoNaskhArabicUI-Bold.ttf NotoNaskhArabicUI-Regular.ttf NotoSans-Bold.ttf NotoSans-BoldItalic.ttf NotoSans-Condensed.ttf NotoSans-CondensedBold.ttf NotoSans-CondensedBoldItalic.ttf NotoSans-CondensedItalic.ttf NotoSans-Italic.ttf NotoSans-Light.ttf NotoSans-LightItalic.ttf NotoSans-Regular.ttf NotoSansArabic-Bold.ttf NotoSansArabic-Regular.ttf NotoSansArabicUI-Bold.ttf NotoSansArabicUI-Regular.ttf NotoSansArmenian-Bold.ttf NotoSansArmenian-Regular.ttf NotoSansGeorgian-Bold.ttf NotoSansGeorgian-Regular.ttf NotoSansHebrew-Bold.ttf NotoSansHebrew-Regular.ttf NotoSansLao-Bold.ttf NotoSansLao-Regular.ttf NotoSansLisu-Regular.ttf NotoSerif-Bold.ttf NotoSerif-BoldItalic.ttf NotoSerif-Condensed.ttf NotoSerif-CondensedBold.ttf NotoSerif-CondensedBoldItalic.ttf NotoSerif-CondensedItalic.ttf NotoSerif-Italic.ttf NotoSerif-Light.ttf NotoSerif-LightItalic.ttf NotoSerif-Regular.ttf NotoSerifArmenian-Bold.ttf NotoSerifArmenian-Regular.ttf NotoSerifGeorgian-Bold.ttf NotoSerifGeorgian-Regular.ttf NotoSerifHebrew-Bold.ttf NotoSerifHebrew-Regular.ttf NotoSerifLao-Bold.ttf NotoSerifLao-Regular.ttf ReemKufi-Regular.ttf Rubik-Bold.ttf Rubik-BoldItalic.ttf Rubik-Italic.ttf Rubik-Regular.ttf Scheherazade-Bold.ttf Scheherazade-Regular.ttf SourceCodePro-Black.ttf SourceCodePro-BlackIt.ttf SourceCodePro-Bold.ttf SourceCodePro-BoldIt.ttf SourceCodePro-ExtraLight.ttf SourceCodePro-ExtraLightIt.ttf SourceCodePro-It.ttf SourceCodePro-Light.ttf SourceCodePro-LightIt.ttf SourceCodePro-Medium.ttf SourceCodePro-MediumIt.ttf SourceCodePro-Regular.ttf SourceCodePro-Semibold.ttf SourceCodePro-SemiboldIt.ttf SourceSansPro-Black.ttf SourceSansPro-BlackIt.ttf SourceSansPro-Bold.ttf SourceSansPro-BoldIt.ttf SourceSansPro-ExtraLight.ttf SourceSansPro-ExtraLightIt.ttf SourceSansPro-It.ttf SourceSansPro-Light.ttf SourceSansPro-LightIt.ttf SourceSansPro-Regular.ttf SourceSansPro-Semibold.ttf SourceSansPro-SemiboldIt.ttf SourceSerifPro-Black.ttf SourceSerifPro-BlackIt.ttf SourceSerifPro-Bold.ttf SourceSerifPro-BoldIt.ttf SourceSerifPro-ExtraLight.ttf SourceSerifPro-ExtraLightIt.ttf SourceSerifPro-It.ttf SourceSerifPro-Light.ttf SourceSerifPro-LightIt.ttf SourceSerifPro-Regular.ttf SourceSerifPro-Semibold.ttf SourceSerifPro-SemiboldIt.ttf opens___.ttf )

@tml1024
Copy link
Contributor

tml1024 commented Nov 4, 2020

As can be seen in this screenshot, the fonts bundled with the app do show up. This is the 4.2.11-1 version from the App Store. This is on iOS 14.1.
F918EA44-C5A7-40C2-AB85-1553CAD95A6B_1_105_c

@smirta
Copy link
Author

smirta commented Nov 4, 2020 via email

@tml1024
Copy link
Contributor

tml1024 commented Nov 4, 2020

OK, so you mean fonts installed by other apps, and available to for instance the Collabora Office app only by using new APIs, and not the traditional CoreText APIs. Fixing this will not be trivial.

@smirta
Copy link
Author

smirta commented Nov 4, 2020

No, fonts that are installed to the system. You can install fonts from the app store and after this they show up in "Settings > General" "Fonts" and should be available to all apps installed.

@smirta
Copy link
Author

smirta commented Nov 4, 2020

but yes, according to Apple's release notes it seems that you'll have to refactor the coretext api calls.

@tml1024
Copy link
Contributor

tml1024 commented Nov 4, 2020

No, fonts that are installed to the system. You can install fonts from the app store and after this they show up in "Settings > General" "Fonts" and should be available to all apps installed.

One can also install fonts from apps; I installed the Adobe Creative Cloud app, installed one font from it, and it showed up in that location you mentioned and was usable in Pages. How do I find fonts as such in the App Store, that aren't part of an app? I don't see any "Fonts" category?

@tml1024
Copy link
Contributor

tml1024 commented Nov 4, 2020

Bah, this is messier than expected. Note at 18:05 in the WWDC 2019 video that apps are not able to enumerate what fonts provided (and registered) by other apps are present. A specific system dialog must be used to let the user choose one of them. This of course is completely incompatible with how the Collabora Office displays its font selection thing.

@tml1024
Copy link
Contributor

tml1024 commented Nov 4, 2020

I guess one possibility would be to have a fake entry in the tunnelled font list (something like "select custom font") that would cause a call into the native iOS code to bring up a UIFontPickerViewController. But implementing that is not trivial either, there are no similar mechanisms in use already that would mix tunnelled dialogs and native dialogs. (Note that when I say "native" here, I mean really native, using UIKit, not something implemented in JS, CSS, and SVG.)

@tml1024
Copy link
Contributor

tml1024 commented Nov 5, 2020

@smirta , in which part of the Collabora Office iOS app UI is it most important to be able to select these 3rd-party fonts: In the notebookbar, or in the (tunnelled) Format > Character dialog, or in the sidebar?

@smirta
Copy link
Author

smirta commented Nov 5, 2020

@smirta , in which part of the Collabora Office iOS app UI is it most important to be able to select these 3rd-party fonts: In the notebookbar, or in the (tunnelled) Format > Character dialog, or in the sidebar?

As a user I'd say the notebookbar (that's the one in the top bar, right?). But I think it should be available everywhere. Anything else will lead to confusion.

Unfortunately we cannot help you a lot with this. We do not use Apple products at all and therefore there is not a lot of know-how around.

@tml1024
Copy link
Contributor

tml1024 commented Nov 5, 2020

I wonder if there is some free (or cheap) and non-trivial third-party app (that preferably has existed for several years) that knows how to use such fonts registered by other third-party apps? It would be interesting to see how it has integrated the new UIFontPickerViewController into its existing UI. One can't really compare to what Pages does, as it seems to be able to use some non-private APIs to be able to get those third-party fonts to show up in its UI which definitely does not use just the UIFontPickerViewController. I think.

@tml1024
Copy link
Contributor

tml1024 commented Nov 5, 2020

FWIW, Google's "Docs" app does not seem to provide access even to the system-provided fonts on iOS (see https://developer.apple.com/fonts/system-fonts/ ), huh? (And even less to ones provided and registered by other third-party apps.)

@smirta
Copy link
Author

smirta commented Nov 5, 2020

If we can package those fonts with the app, that would be an immediate solution, but I think it needs to be fixed in longer term anyway

@tml1024
Copy link
Contributor

tml1024 commented Nov 5, 2020

What fonts is it that you are interested in?

@tml1024
Copy link
Contributor

tml1024 commented Nov 5, 2020

We can only include suitably licensed fonts in the app.

@smirta
Copy link
Author

smirta commented Nov 5, 2020

yeah, sure. Let's discuss this via e-mail

@tml1024
Copy link
Contributor

tml1024 commented Nov 5, 2020

BTW, I started a trial subscription of Office 365, and in the Word app on iOS I don't see a font called "Yrsa" that I registered in the Adobe Creative Cloud app. (It does show up in Pages, and in Collabora Office with the fix I am working on.) So Microsoft does still have the problem at least in Word.

Screenshots:

Word, "Office-compatible Fonts":
BD701776-88BE-41EF-A91A-226616B2D0F9_1_105_c

Word, "iOS Fonts":
E893EFB8-E87B-45A3-A622-324CB2444EAB_1_105_c

Pages:
B00CB2D8-E772-420B-9294-8C4C486FF42D_1_105_c

Collabora Office:
769481BB-3F27-4AA3-85F0-39CB371A3FEB_1_105_c

@smirta
Copy link
Author

smirta commented Nov 5, 2020

This is brilliant @tml1024 ! Yeah, we are aware that the Word app also has this problem. But you know, we want Collabora to be better :)

tml1024 pushed a commit that referenced this issue Nov 5, 2020
That way we can use UIFontPickerViewController which gives acess also
to fonst provided and registered by other third-party apps on iOS.
These fonts are not available otherwise. They don't show up when vcl
enumerates fonts in core.

This patch is work in progress for
#472 . This patch
affects only the font name selection control in the notebookbar. On
iOS this is now no longer a "combo box" (implemented by the external
"select2" Javascript library, if I understand correctly), but a button
that brings up a native iOS control). For now it is just a plain HTML
button. It should ideally later be styled to fit better into the
visual style of the notebookbar.

Change-Id: Ic5e53cad09ffa8c99336dfed594337525909dc90
Signed-off-by: Tor Lillqvist <tml@collabora.com>
tml1024 pushed a commit that referenced this issue Nov 5, 2020
That way we can use UIFontPickerViewController which gives acess also
to fonst provided and registered by other third-party apps on iOS.
These fonts are not available otherwise. They don't show up when vcl
enumerates fonts in core.

This patch is work in progress for
#472 . This patch
affects only the font name selection control in the notebookbar. On
iOS this is now no longer a "combo box" (implemented by the external
"select2" Javascript library, if I understand correctly), but a button
that brings up a native iOS control). For now it is just a plain HTML
button. It should ideally later be styled to fit better into the
visual style of the notebookbar.

Change-Id: Ic5e53cad09ffa8c99336dfed594337525909dc90
Signed-off-by: Tor Lillqvist <tml@collabora.com>
tml1024 pushed a commit that referenced this issue Nov 5, 2020
That way we can use UIFontPickerViewController which gives acess also
to fonst provided and registered by other third-party apps on iOS.
These fonts are not available otherwise. They don't show up when vcl
enumerates fonts in core.

This patch is work in progress for
#472 . This patch
affects only the font name selection control in the notebookbar. On
iOS this is now no longer a "combo box" (implemented by the external
"select2" Javascript library, if I understand correctly), but a button
that brings up a native iOS control). For now it is just a plain HTML
button. It should ideally later be styled to fit better into the
visual style of the notebookbar.

Change-Id: Ic5e53cad09ffa8c99336dfed594337525909dc90
Signed-off-by: Tor Lillqvist <tml@collabora.com>
(cherry picked from commit 977af59)
tml1024 pushed a commit that referenced this issue Nov 5, 2020
That way we can use UIFontPickerViewController which gives acess also
to fonst provided and registered by other third-party apps on iOS.
These fonts are not available otherwise. They don't show up when vcl
enumerates fonts in core.

This patch is work in progress for
#472 . This patch
affects only the font name selection control in the notebookbar. On
iOS this is now no longer a "combo box" (implemented by the external
"select2" Javascript library, if I understand correctly), but a button
that brings up a native iOS control). For now it is just a plain HTML
button. It should ideally later be styled to fit better into the
visual style of the notebookbar.

Change-Id: Ic5e53cad09ffa8c99336dfed594337525909dc90
Signed-off-by: Tor Lillqvist <tml@collabora.com>
(cherry picked from commit 977af59)
@tml1024
Copy link
Contributor

tml1024 commented Nov 5, 2020

Build 6.4.0 (9) in TestFlight contains the changes so far.

@nikslor
Copy link

nikslor commented Nov 12, 2020

I think the solution we have in 6.4.0 (12) is quite nice - can this be closed @smirta, @tml1024?

@smirta
Copy link
Author

smirta commented Nov 12, 2020

I think the solution we have in 6.4.0 (12) is quite nice - can this be closed @smirta, @tml1024?

Is it possible to select the font in the sidebar now? I think @tml1024 will close the issue when he thinks it's complete.

@tml1024 tml1024 closed this as completed Nov 30, 2020
@tml1024
Copy link
Contributor

tml1024 commented Nov 30, 2020

Ah, but yeah, the sidebar is still an issue, re-opening.

@tml1024 tml1024 reopened this Nov 30, 2020
Ezinnem pushed a commit to Ezinnem/online that referenced this issue Dec 22, 2020
That way we can use UIFontPickerViewController which gives acess also
to fonst provided and registered by other third-party apps on iOS.
These fonts are not available otherwise. They don't show up when vcl
enumerates fonts in core.

This patch is work in progress for
CollaboraOnline#472 . This patch
affects only the font name selection control in the notebookbar. On
iOS this is now no longer a "combo box" (implemented by the external
"select2" Javascript library, if I understand correctly), but a button
that brings up a native iOS control). For now it is just a plain HTML
button. It should ideally later be styled to fit better into the
visual style of the notebookbar.

Change-Id: Ic5e53cad09ffa8c99336dfed594337525909dc90
Signed-off-by: Tor Lillqvist <tml@collabora.com>
(cherry picked from commit 977af59)
@tml1024
Copy link
Contributor

tml1024 commented Mar 18, 2021

Re-closing based on Nicolas's comment... The working notebookbar button is a good enough workaround. The sidebar is eventually being re-implemented in JavaScript anyway.

@tml1024 tml1024 closed this as completed Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ios Specific to the Collabora Office iOS app, or to online accessed from i(Pad)OS devices
Projects
None yet
Development

No branches or pull requests

5 participants