pro_imaj 5 Posted April 12, 2020 (edited) Hi, I am using Edit and Label Segoe UI font in Delphi FMX project. While it looks properly on Windows, there are standard fonts on the ios side. How can I fix this. * I was viewing correctly on my ios phone without any additional settings before. I am facing this problem after the macOS renewal but I think the problem is in Delphi. I would appreciate your help. Delphi: 10.3.3 macOS: 10.15.4 xcode: 11.4 Edited April 12, 2020 by pro_imaj Share this post Link to post
vfbb 285 Posted April 13, 2020 No, the problem is not with delphi, yo can see the full list of default font of the iOS https://developer.apple.com/fonts/system-fonts/ The current default font is Helvetica Neue. If you put a font family name that not exists, the iOS will load the Helvetica Neue font. To avoid install custom font, the best you can do is find a similar default font to use in the iOS 1 Share this post Link to post
pro_imaj 5 Posted April 13, 2020 7 hours ago, vfbb said: No, the problem is not with delphi, yo can see the full list of default font of the iOS https://developer.apple.com/fonts/system-fonts/ The current default font is Helvetica Neue. If you put a font family name that not exists, the iOS will load the Helvetica Neue font. To avoid install custom font, the best you can do is find a similar default font to use in the iOS Thank you for the answer. But before I was developing with the same font without any problems, I published the applications to the app store and there was no problem. If I apply the solution you said, I will have to deal with it while compiling to the android side at this time, whereas in the past, I was working smoothly with the same font on both windows and Andriod and iOS without doing anything like this. * Now the problem is not only with this font, none of the fonts in Windows are not working by ios! Thank you. Share this post Link to post
Dave Nottage 557 Posted April 13, 2020 38 minutes ago, pro_imaj said: But before I was developing with the same font without any problems, I published the applications to the app store and there was no problem. Please indicate what you mean by "before", e.g. was it a different version of Delphi? Deploying to a device with a different version of iOS, if so, which version(s)? Were your applications deploying the custom fonts? . 1 Share this post Link to post
pro_imaj 5 Posted April 13, 2020 16 minutes ago, Dave Nottage said: Please indicate what you mean by "before", e.g. was it a different version of Delphi? Deploying to a device with a different version of iOS, if so, which version(s)? Were your applications deploying the custom fonts? . Hi, Everything is the same on the Delphi side. I made the last updates on the macOS, Xcode and ios phone I saw the result. macOs: 10.15.4 Xcode: 11.4 ios: 13.4.1 The app uses the Segoe UI font, before it was running by the macos without installing this font. Thank you for the answer. Share this post Link to post
pro_imaj 5 Posted April 15, 2020 (edited) I formatted the computer, reinstalled everything but my problem is still not resolved. Problem is this; Delphi fmx uses Segoe UI as the standard font family, which is how I used the whole project. But macOs replaces this font with Helvetica Nue, which looks very bad. Is there an easy way to make the Segoe UI the font of the project I compiled by macOs? Edited April 15, 2020 by pro_imaj Share this post Link to post
Dave Nottage 557 Posted April 15, 2020 2 hours ago, pro_imaj said: Is there an easy way to make the Segoe UI the font of the project I compiled by macOs? http://firemonkeyblog.blogspot.com/2014/12/how-to-use-custom-font-in-ios-delphi.html 1 Share this post Link to post
pro_imaj 5 Posted April 16, 2020 42 minutes ago, Dave Nottage said: http://firemonkeyblog.blogspot.com/2014/12/how-to-use-custom-font-in-ios-delphi.html Thank you for the answer. I have read this article before but cannot apply it. Can you look at the project file I made in the annex when you are available. Thank you. segoeui.zip Share this post Link to post
Dave Nottage 557 Posted April 16, 2020 1 hour ago, pro_imaj said: Can you look at the project file I made in the annex Your info.plist.TemplateiOS.xml file is incorrect. Instead of: <key>Segoe UI</key> It should be: <key>UIAppFonts</key> As per the article Share this post Link to post
pro_imaj 5 Posted April 16, 2020 7 hours ago, Dave Nottage said: Your info.plist.TemplateiOS.xml file is incorrect. Instead of: <key>Segoe UI</key> It should be: <key>UIAppFonts</key> As per the article Have you tried and seen the correct result? It is also tried as you said, but the result is negative! Share this post Link to post
Dave Nottage 557 Posted April 17, 2020 On 4/16/2020 at 7:00 PM, pro_imaj said: Have you tried and seen the correct result? Yes, as per the article. Make sure you're actually deploying the font files (Project|Deployment in the Delphi IDE), and to the correct Remote Path. i.e: .\ Also make sure that the entries in info.plist.TemplateiOS.xml match exactly with the actual filename - filenames are case sensitive on iOS. 1 Share this post Link to post
pro_imaj 5 Posted April 18, 2020 22 hours ago, Dave Nottage said: Yes, as per the article. Make sure you're actually deploying the font files (Project|Deployment in the Delphi IDE), and to the correct Remote Path. i.e: .\ Also make sure that the entries in info.plist.TemplateiOS.xml match exactly with the actual filename - filenames are case sensitive on iOS. Thank you for your answer. My conclusion on this issue; There is a mismatch problem between the latest version of Delphi (10.3.3) and the latest version of xcode. No problem when compiling the same project in older xcode versions. So I think this problem will be solved when 10.4 is released. I spent all 10 days rebuilding everything including the computer to solve this problem and the final result I got was negative. I am continuing the project. I will recompile the ios project with the new version in 10.4 version. Thanks. Share this post Link to post
Dave Nottage 557 Posted April 18, 2020 14 minutes ago, pro_imaj said: There is a mismatch problem between the latest version of Delphi (10.3.3) and the latest version of xcode. I'm using Delphi 10.3.3, the latest released version of Xcode (11.4), building against the latest iOS SDK (13.4) and it works on my iPhone X which has iOS 13.4. I've attached my test project (which uses the Anton font, from here: https://fonts.google.com/specimen/Anton). Perhaps if you have a test project, you could attach it so it might be discovered what is going wrong. CustomFontDemo.zip 1 Share this post Link to post
pro_imaj 5 Posted April 19, 2020 18 hours ago, Dave Nottage said: I'm using Delphi 10.3.3, the latest released version of Xcode (11.4), building against the latest iOS SDK (13.4) and it works on my iPhone X which has iOS 13.4. I've attached my test project (which uses the Anton font, from here: https://fonts.google.com/specimen/Anton). Perhaps if you have a test project, you could attach it so it might be discovered what is going wrong. CustomFontDemo.zip Hi, You are super! The deficiency I made was the codes that you added to the button, and it worked without any problem. But the problem is this; I already set the fonts of all objects to "Segoe UI" so there are too many forms and objects. The font of all objects such as edits, labels, grids, etc. What is the easiest way to apply the code you collectively write on the ios side with the "Segoe UI" set on Delphi side. Thank you for your attention. Share this post Link to post
Dave Nottage 557 Posted April 19, 2020 6 hours ago, pro_imaj said: The deficiency I made was the codes that you added to the button, It also works for me just by having the Font.Family property in TextSettings set to the correct value (i.e. Anton) at design time. Using the button and code was just to demonstrate that there's a very obvious change in the font. I suspect there's something else wrong with your project, which is why I asked to post a test case. 1 Share this post Link to post
pro_imaj 5 Posted April 19, 2020 40 minutes ago, Dave Nottage said: It also works for me just by having the Font.Family property in TextSettings set to the correct value (i.e. Anton) at design time. Using the button and code was just to demonstrate that there's a very obvious change in the font. I suspect there's something else wrong with your project, which is why I asked to post a test case. Hi, Sample file is attached. If it's normal without pressing the button, you should see the font automatically, but it doesn't. Thanks. Project1.zip Share this post Link to post
Dave Nottage 557 Posted April 20, 2020 5 hours ago, pro_imaj said: you should see the font automatically, but it doesn't. That's because you have Family in the StyledSettings property set to True in the Object Inspector (i.e. at design time). You need to set it to False Share this post Link to post
pro_imaj 5 Posted April 20, 2020 (edited) 4 hours ago, Dave Nottage said: That's because you have Family in the StyledSettings property set to True in the Object Inspector (i.e. at design time). You need to set it to False If I don't press the button, it didn't work! Edited April 20, 2020 by pro_imaj Share this post Link to post
Dave Nottage 557 Posted April 20, 2020 I see what the problem is now: it's because selecting Segoe UI at design-time results in the Family value not being stored in the .fmx, because it's the default for Windows. I'd consider that a design fault, since it does not account for using a font with the same name on platforms other than Windows. Easiest solution: use something that looks like Segoe UI, but isn't 🙂 Any other solution would seem a bit difficult.. 2 Share this post Link to post
pro_imaj 5 Posted April 20, 2020 28 minutes ago, Dave Nottage said: I see what the problem is now: it's because selecting Segoe UI at design-time results in the Family value not being stored in the .fmx, because it's the default for Windows. I'd consider that a design fault, since it does not account for using a font with the same name on platforms other than Windows. Easiest solution: use something that looks like Segoe UI, but isn't 🙂 Any other solution would seem a bit difficult.. Yes, I have determined it this way, but the interesting thing is that I had no problems with the same delphi version before, so the source of this problem seems to be xcode. It is a very troublesome and unnecessary job that I will have to make a continuous loop for objects in each form to solve the problem 😞 Share this post Link to post
pro_imaj 5 Posted April 20, 2020 While I can specify the text family with the code below on the VCL side, I could not find out how to do it on the FMX side, so I can solve the problem in this way! Application.Initialize; Application.DefaultFont.Name: = 'Segoe UI'; 1 Share this post Link to post
Dave Nottage 557 Posted April 21, 2020 13 hours ago, pro_imaj said: I can solve the problem in this way! Excellent! I was not aware of that property; thanks 🙂 Share this post Link to post
pro_imaj 5 Posted April 21, 2020 4 hours ago, Dave Nottage said: Excellent! I was not aware of that property; thanks 🙂 This property is valid for VCL. Unfortunately this property is not on the FMX side 😞 Share this post Link to post
pro_imaj 5 Posted April 23, 2020 Hi, I solved the problem permanently, adding the project to pass the following file. *I add that someone might need it in the future. unit uFont; interface uses FMX.Platform, FMX.Graphics; type TmyFMXSystemFontService = class(TInterfacedObject, IFMXSystemFontService) public function GetDefaultFontFamilyName: string; function GetDefaultFontSize: Single; end; implementation function TmyFMXSystemFontService.GetDefaultFontFamilyName: string; begin Result := 'Segoe UI'; end; function TmyFMXSystemFontService.GetDefaultFontSize: Single; begin Result := 12; end; procedure InitFont; begin if TPlatformServices.Current.SupportsPlatformService(IFMXSystemFontService) then TPlatformServices.Current.RemovePlatformService(IFMXSystemFontService); TPlatformServices.Current.AddPlatformService(IFMXSystemFontService, TmyFMXSystemFontService.Create); end; initialization InitFont; end. 2 1 Share this post Link to post