Does anybody know of a simple script-detection algorithm (or heuristic) for font switching?
This came up with one of my clients. Suppose you have a guest book on your web site, and seven visitors left you the following inspiring messages:
- ã™ã¹ã¦ã®äººé–“ã¯ã€ç”Ÿã¾ã‚ŒãªãŒã‚‰ã«ã—ã¦è‡ªç”±ã§ã‚りã€ã‹ã¤ã€å°ŠåŽ³ã¨æ¨©åˆ©ã¨ã«ã¤ã„ã¦å¹³ç‰ã§ã‚る。
- 人人生而自由,在尊严和æƒåˆ©ä¸Šä¸€å¾‹å¹³ç‰ã€‚
- Semua orang dilahirkan merdeka dan mempunyai martabat dan hak-hak yang sama.
- 人人生而自由,在尊嚴和權利上一律平ç‰ã€‚
- Alle Menschen sind frei und gleich an Würde und Rechten geboren.
- ‘Ολοι οι άνθÏωποι γεννιοÏνται ελεÏθεÏοι και ίσοι στην αξιοπÏÎπεια και τα δικαιώματα.
- ëª¨ë“ ì¸ê°„ì€ íƒœì–´ë‚ ë•Œë¶€í„° ìžìœ 로우며 ê·¸ ì¡´ì—„ê³¼ ê¶Œë¦¬ì— ìžˆì–´ ë™ë“±í•˜ë‹¤.
(It looks like your visitors all read the Universal Declaration of Human Rights courtesy of the UDHR in Unicode project).
Now suppose you are so touched that you want to lay out all seven messages in a PDF file, and print it out as a booklet. You have a beautiful layout template, and various complementary fonts: Latin script, Japanese, Korean, simplified Chinese, Traditional Chinese, and Greek script.
Which font to you apply to each message? More importantly, is there a simple heuristic by which software can make the choice? (More after the jump.)
Continue Reading »
1 Comment »