Rendering Japanese text in Flex - unicode

Flex documentation says that we need to include fonts for Japanese characters, Flash Player can't access fonts from the system in which it is running. If my flex application has to support all languages, should I embed an entire font library into swf-file? In my case data is fed from MySQL, so I can't fall back to runtime loading.
Is there any ttf font equivalent to Arial Unicode MS font?
Kindly help me out.

If you are using Flex 4 SDK then it should happen automatically - you just need to define a font fallback chain such as,
fontFamily: "Hiragino Kaku Gothic Pro W3","MS GOTHIC","_sans";

Related

How to build a font generator in iOS Swift and allowing pasting to clipboard

I'm now building a listview to display fonts from the UIFonts framework. However, for using UIPasteboard.general.string, the fonts are not copied to the clipboard and only the plain text is transferred.
I've tried including the MobileCoreServices framework and use kUTTypeRTF to implement it. But there is no detailed documentation on it.
May I know how can I build a custom font list and allowing the text be selected and pasted with its font styling onto the other applications (like Notes or Facebook post), just like the font generator hosted online?
I'm now working on the two following UIFonts, but I'm not able to keep its formatting while pasting from the clipboard.
let fonts: [String] = ["BodoniSvtyTwoOSITCTT-Book", "ChalkboardSE-Regular"]
You cannot copy-paste text with a font on your iPhone.
FancyLetters also cannot do this. It just shows you characters that look like they are printed.
For example, the letter "A" has variations: "𝓐", "𝒜", "𝔸". But this is not font-altered text, StackOverflow does not allow it either. These are characters from Unicode table. They are the same characters as "A" or "B", except that without special modifiers the keyboard will not print them for you, e.g. SHIFTOPTIONK = .
Any font is superimposed over Unicode characters.
I recommend you to read an excellent article Emoji under the hood. It's about how emoji are drawn on devices, but it also explains a lot about the construction of characters and how they are rendered on different devices.
Or font generator also cannot do this. It just shows you characters that look like they are printed

How to display Chinese in plot's label

How to display Chinese in plot's label
我是英文版64位win7系统,在matlab中的命令行和文件中可以输入中文,但是保存再打开之后中文就变成“???”了。然后在plot里面xlabel中也无法使用中文,画出来的图片上就是“???”。
请问怎么才能在MatLab中使用中文?
Have you Googled yourself? Try https://www.google.com/search?q=MATLAB%20%E4%B9%B1%E7%A0%81. Basically you need to use an appropriate font, depending on which OS and MATLAB you use.
You can either directly use Chinese font (such as SimSun 宋体) or properly configure font linking in registry (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\FontLink\SystemLink). I wrote some articles about this in ThemeX forum. Pay a visit.

smartGWT and RichTextEditor: How to set the available Fonts?

I am using the RichTextEditor from smartGWT and it comes with 7 different fonts by default, but I would like to support ONLY 1 font type, and not 7, but the font I want to support does not come with the RichTextEditor. How can I set the supported font types from the RichTextEditor?
It seems that they don't expose much of that functionality in the RichTextEditor API, however I believe it could be achieved by doing the following:
RichTextEditor rte = new RichTextEditor();
// remove the font controls
rte.setControlGroups("formatControls", "styleControls", "colorControls");
// set the base font for the editor, could also be done with a <span> tag
rte.setValue("<font face="Bookman Old Style, Book Antiqua, Garamond"></font>");

Which iPhone system fonts can I use safely and which are recommended for what kind of display purpose?

Fonts are like a coin lost in the forrest: You're never sure where to look first. Had to say that ;-)
Ok, so the problem: I come from the web dev world and my mind is screwed up completely regarding fonts. There is a UIFont class that can be used to specify how text in a label should look like. Unfortunately it seems I have to know a lot of font secrets to use it properly. Does anyone know which kind of fonts I can specify and which are "safe to use"?
With safe to use I mean: Which ones are not dependent a lot on the language of the user, i.e. completely inavailable if the user has Chinese language active. Nor sure if that would be a different font, all those funny symbols and stuff. I want to use the font in a "tight graphical environment" where I have a design that's made to match that font. That would look like crap if in japan the font is italic style and in greece they see huge chunky and bold letters.
So which fonts would be best to use to avoid most of uglyness-problems arount internationalization and different devices?
Here are a list of available fonts for the iPhone OS.
Also, you can use the UIFont APIs systemFontOfSize:, boldSystemFontOfSize: and italicSystemFontOfSize: - any of which I would imagine will handle localization reasonably.
More UIFont documentation can be found here.

how to use custom font in html pages for UIWebView?

I am having the "Futura.ttf" font file.
I am displaying a HTML page in the UIWebView, but my requirement is that i want to use the custom font in my css file.
so is there any way that i can use the custom font in my css file ???
All suggestions are welcomed.
Thanks.
It is possible to load custom fonts into your UIWebView in iOS3.2 and above. Add the font to your bundle (see here) then just reference the font in your UIWebView's stylesheet like you would any other font:
<style type='text/css'>font { font-family: DroidSerif; } </style>
You have Cufon and sIFR as your options.
Typeface.js is a pure JavaScript Replacement
Cufon is a pure JavaScript Replacement
sIFR is Flash and Java font implementation,
FLIR JavaScript and PHP implementation
Some Comparisons
http://thatguynamedandy.com/blog/text-replacement-comparison
http://thinkclay.com/technology/cufon-sifr-flir
http://aaronwinborn.com/blogs/aaron/cufón-alternative-sifr-image-replacement
Below is taken from this question Worth reading the whole thread, has greatdetails.
Typeface.js
Advantages:
User doesn’t have to have Flash
plugin installed on their browser
Easier to create with just a few
lines of Javascript
For page loading it just needs to
load the Javascript
Disadvantages:
Text is not selectable because it
outputs it like an image. I looked at
some examples, right clicked on a
word and had to view as an image.
Every single word had this behaviour.
Big thumbs down.
Usage for body copy will slow down
loading time, so it is recommended to
use only for headlines.
Cannot be read by screen readers
Visual looks blurry
Not all browser compliant and still
has a lot of development left to be
done
sIFR
Advantages:
Can be read by screen readers as a
normal headline because it is a
behaviour layer on top of the markup
and styling.
Text is selectable
SEO friendly
Displays text as is like any other
web font. Crisp and not blurry!
Has addons like jQuery sIFR Plugin!
Disadvantages:
Requires Javascript to be enabled
Flash plugin must be installed in the
browser
Need Adobe Flash Studio to create it
BUT there is a pretty nifty sIFR
generator that creates the file for
you!
For page loading, it has to request
for Flash, Javascript and CSS files
attached to it, which can potentially
get bogged down if you are using sIFR
in too many places.
Cannot display on an iPhone. Yet…
Cufón (similar to Typeface.js)
Enter Cufón, the Javascript-based font replacement solution which makes heavy use of canvas and VML. This offers a great alternative to other solutions out there - no Flash or images required.
There are some issues with using Cufón on a live site, the most notable being the inability to highlight and copy/paste text, which is really the biggest issue for your site's users.
Combine that with the EULA issues, which prevent you from being able to legally embed fonts in Javascript files for most fonts on the market today.
The other issue is knowing what fonts can be used with Cufón. For sIFR, most fonts are fair game, since the font is embedded in a Flash movie, which is typically an approved usage by most font foundries for most fonts. With Cufón, the Javascript files used for the font can be easily "stolen" and either used on another website or reverse engineered.