I'm trying to design an interface for a Japanese iOS app using Interface Builder.
Since I need to use Japanese text for the labels and other UI elements, a Japanese font must be used. In the case of iOS, the provided Japanese font is Hiragino Sans.
Using the system font for iOS interfaces simplifies a lot of stuff. You can use, for instance, TextStyles, which will handle all the Dynamic Type and other accessibility features such as Bold Text automatically for you. The code needed to fully support these features using a custom font, even if it's included in the system like Hiragino, is not trivial (but it can be done if there's no alternative).
Thankfully, UIKit is smart and automatically uses Hiragino Sans for Japanese characters on labels and other elements.
However, this automatic replacement apparently occurs on a per-character basis instead of on the whole UILabel / element.
You can notice this in the following screenshots. There are two labels, the first using the System Font, and the second one explicitly using Hiragino. The first screenshot is from Interface Builder, where San Francisco is used even for the Japanese characters. The second screenshot is from the simulator, which replaces the system font's Japanese characters with hiragino. You can notice these subtle changes especially in the following characters: ※, 角, ロ, and the latin text for Hiragino.
What I would like to know is whether setting the System font and forgetting about these details is how I'm supposed to design the interface, and the expected behavior for Japanese users, or whether I should try to use Hiragino on the whole UI element. (I'm leaning towards this second option here, especially because of how the ※ character is handled).
In this second case, is there something I'm missing where I can tell UIKit that all my UI elements should use Hiragino even for the non-Japanese characters? Is there a way to tell it to just use Hiragino when a system font is concerned? Or is setting Hiragino explicitly the only option here, with all the extra code using a custom font entails in order to support dynamic type and other accessibility features?
Thanks!
Related
I want to use non-English characters in Godot, but when I write them (In every node, like a Label or a Button) and run the project, the text does not display. For example, I write some Arabic characters in a Label and run the project, but I do not see anything. But I can see the characters in editor separately and reversely. ("عالم" is displayed "م ل ا ع")
I know that this problem is discussed on GitHub, but there was not any good solution. Please advise me a good and simple solution to solve this problem. I think it is not solved so far.
The default Label font in Godot doesn't support non-ASCII characters.
You can try to change the font in your Label node to one that supports non-ASCII symbols by picking a font from your computer, or if it doesn't exist on your device, uploading it from some site like Google Fonts, and choosing an arabic-supporting font, like Amiri.
After choosing the font for your Label node, open the Custom Fonts property in the editor of the node, and create a DynamicFont, and in Font => Font Data press Load and choose your font in the opened window in the file system (.ttf or any another font extension).
When dealing with an element that contains text, you can set the text to attributed to allow for more customization. But this never actually works. There is the little font icon that opens a window where you can select a font, a color, bold/italic/underlined, font size, etc. Changing anything in this window does nothing (at least for me, tested on multiple macs and multiple ios devices over the past two years).
There are some smart solutions as suggested here for example. But aside from having to open external software just to edit some text in a button, these solutions are not exactly complete. Usually some attributes can be copied from a rich text editor, but not all the attributes (in my case, I can't find an editor that copies font, font style AND text color). Also, most of these editor don't have a lot of fonts available.
So, to get to the point: I want to have a UIButton, with the text "Wachtwoord vergeten?", white, bold and underlined, Helvetica Neue Medium 18pt. How do I do this? I just want to get this working, but a more general solution would be great for future readers.
I am creating PDF with pre filled values in Chinese but when opening the PDF all the textfields containing Chinese text are empty. When focusing a textfield the Chinese text comes visible but is hided again when unfocusing the field. What could be the issue?
Please share some more info, as there could be more than one reason why the appearances aren't generated by iText.
A. The first reason is explained in the StackOverflow question "AcroForm values missing after flattening". In this case, the PDF contains a parameter that instructs iText not to generate appearances, which would explain why you don't see any value up until you click the field, in which case the viewer will create them.
B. The second reason is explained in section 8.3.3 (entitled "Text fields and fonts") of my book. In this case, the parameter in the PDF doesn't prevent the creation of field appearances, but iText fails to do so because you're not providing a font that knows how to display the Chinese characters.
See for instance figure 8.3 and 8.4 of the book.
In figure 8.3, you see that Chinese text isn't displayed in the upper window. By fixing the form (using two different strategies), the Chinese text appears in the lower two windows. Note that the Chinese text won't appear in all viewers in the case of the middle window.
In figure 8.4, you see that Korean text isn't displayed in the upper window, nor in the third window. In all other windows, different strategies were used to fix this problem:
It would lead us too far to discuss all the different strategies in an answer on SO. Instead, please take a look at the TextFontFields example (for the C# version, please take a look at the ported examples). My guess is that you'll benefit most from the AddSubstitutionFont() method, provided that you use a font of which a subset will be embedded in the document (in the example arialuni.ttf is used).
In case of A., the phenomenon also concerns other languages. In case of B., the parameter is correct, but you're not providing a font that can be used to generate the appearance.
I'm currently working on an app which displays some funky characters. They are proper unicode characters There is no system font that contains these glyphs on iOS, so I made a custom font that contains only these glyphs.
Now, I don't want to replace the system font with my custom font, but I want to have iOS load any missing glyphs from my custom font. Can iOS fallback to custom fonts?
Hopefully, you've gotten a reply by now, but the only way this is possible by using a custom font, is to have customise a "normal" fonts non-letter characters by replacing characters like U+2615 (Hot beverage) with your custom glyphs. Thus, you can use your custom font for all your UI, but you would need different characters than you use now to display your custom glyphs
I want to use a special character on an iOS button. When I insert it from special characters collection located in Edit/Special Characters menu it looks like this:
But after I exit the edit mode or run the app on device the character turns into this:
It looks like it uses different font. Is there a way to fix it?
Open up the character viewer (you may need to enable this in the Settings / Language)
You can inspect the arrows in here, and then check the font variations.
Once you've located the font you want, apply that to the label. I suspect you want Lucida Grande Bold.