Google webfont subset sample strings - webfonts

I have written a WordPress plugin that allows any Google Webfont to be used in the CMS. It includes a font previewer that shows "The quick brown fox..." in each selected font. So far it has been used to request the latin (i.e. default) font only Google.
I have now extended the plugin to allow subsets to be requested for the selected fonts. There are a dozen Google Webfont subsets including, for example, latin-ext, greek and cyrillic.
Now the question: in the font preview page, I would like to show what these subsets look like. Are there any well-known or common unicode strings that will do this? I guess I am looking for the equivalent to "The quick brown fox" but for each of the Google subsets.
How the Google subsets map onto unicode named subsets, is not clear, so I may need to find something specific to Google.
Edit:
This is where the sample text is going to go. Maybe this is less exactly a programming problem and more about a source of data.
var settings = jQuery.extend({
...
preview_text: {
'latin': 'The quick brown fox jumps over the lazy dog',
'latin-ext': '?',
'greek': '?',
'greek-ext': '?',
'cyrillic': '?',
'cyrillic-ext': '?'
}
}, options);
If there is a way to programmatically get a selection of characters with glyphs unique to each subset, then I would be happy with that.

Just noticed that Google already provide some sample strings to use in its own font preview pages. The sample text is the same for the extended version as for the non-extended version of each subset that has an extended subset. I'll find a few additional characters for the extended subsets to complete my font preview.

Related

How does each platform display their own versions of emojis?

If you take a bit of text that contains emojis from whatsapp web, and paste it into facebook messenger, you'll get different versions on each platform. How does each platform use their own images as placeholders for emojis? Please note that the emoji code is preserved when copy-pasted. So a melon on one platform will still be a melon on the other platform.
I'm not even sure this is a programming question, if not I'd be very grateful if you could point me to the right direction :)
Emoji are represented as unicode characters that individual platforms and apps can interpret as they see fit. While most modern platforms will automatically translate the unicode character into the appropriate image, some apps will override this behavior and replace the platform-standard unicode character with their own image.
text.replace("{unicodeEmojiString}", "{eitherAMarkerOrImageSpecificToMyApp}"

Is there a name for font families (such as fangchan-secret) that are used to prevent web scraping?

In trying to scrape some data from the website of a housing agency in China (the name of the agency is Anjuke) to gather data for a small personal project I realized that all of the numbers on the website are visually displayed as numbers, but are digitally read as obscure Chinese characters.
Is there a name for this kind of a font or this kind of a technique more specific than "anti-scraping measures"?
Additional information about this specific case:To see this in action you can click on any of the listings from the Anjuke website, and then attempt to copy-and-paste the price (or any HTML element that has the "strongbox" class), and you will see that instead of pasting the number is pastes and obscure Chinese character (such as 驋, 齤, 麣, 龤, or 龒).
Looking at the CSS revealed that these numbers have a font of "fangchan-secret", and a bit of quick googling linked to a blog post in Chinese by zhyuzh3d. I read some Chinese, although not loads. This blog post appears to be a Chinese explanation of how how fangchan-secret is a method to prevent to prevent webscraping, and also an explanation of how to get around around this preventative measure.

'font-family: Symbol' and Windows-1252

I have a bunch of HTML documents that contain some simple text in Windows-1252 encoding, but throughout the text there are numerous appearances of span elements with font-family: Symbol.
For example:
<span style='font-family:Symbol'>Ñ</span>
Which appears as the greek delta - Δ in the browser.
Google told me that using the Symbol font might show different results on different systems, as it's not actually a well defined font.
Is this really true? Is it "unsafe" to use the Symbol font?
If so, is there any way to reliably convert (on my own system) such symbols in the Symbol font to their Windows-1252 counterparts?
It's been always unsafe to rely on having certain font installed on all the computers/smartphones/gadgets that visit your site. There're some font embedding techniques that work reasonably well in some modern browsers but you'd need to repack the Symbol font and I doubt the copyright owner allows you to do it.
Of course, most characters in the Symbol font are not in the Windows-1252 encoding but that should not be an issue. You can use the following map to obtain the appropriate HTML entities. However, you'll have to write a script or program using a programming language (HTML is just a markup language).
When using font-family, if neither of the listed font faces are found on the client, that is without the webfont embeds, may result in changing to default font of client hence a different font replacement for what you'd show to your users.
You may want to use UTF-8 encoding and put the delta (Δ) sign in your HTML content, or use webfont embeds to provide an option, "use the font I want from this".
The problem is that the greek letter you see is just the appearance, the actual letter is something completely different.
I can think of two ways to convert it:
1. Write a script (in your language of choice) that converts each letter to it's Greek counterpart. (Ñ => Δ)
2. Take a screenshot of the document/page and use an OCR-program to convert it to Greek text.

Google Web Fonts encoding/rendering issue

I am trying to solve an issue with Google WebFonts. I want to use font Signika from them. As you can see it has letters such as Š, Ů declared/implemented. On our website, however, it does not render these letters but just standard and in word DOMŮ - letter Ů is in another font and in word DALŠI letter Š in another font. Is there any solution for this? Should I declare some encoding for these types of letters, or where could the problem be?
When i look at your website, i see both the words (and individual letters) you list as problematic in the font Signika.
I do notice however, that you are only calling for the Standard font set, and not the Laten-Extended Subset. On this page you may want to check the box Latin Extended (latin-ext) and update your code if other browsers are experiencing problems.
If characters are implemented in the font file but your site can not display it you need to check if you are calling right subsets:
For example, to request the latin and latin-endended subsets of Oswald, the URL would be:
http://fonts.googleapis.com/css?family=Oswald&subset=latin,latin-ext
For more information:
https://developers.google.com/fonts/docs/getting_started#Subsets
Hope it helps.

Recognizing superscript characters using OCR

I've started a simple project in which it must get an image containing text with superscripts and then by using OCR (currently I'm using tesseract) it has to recognize the superscript characters + the normal ones.
For example, we have a chemical equation such as Cl², but when I use the tesseract to recognize it, it gives me Cl2 (all in one line).
So, what is the solution for this problem? Is there any other OCR API that has the ability to read superscripts?
Very good question that touches more advanced features of any OCR system.
First of all, to make sure you are NOT overlooking the functionality even though it may be there on an OCR system. Make sure to look at your result test not in plain TXT format, but in some kind of rich text capable viewer. TXT viewers, such as Notepad on Windows, often do not support superscript/subscript characters, so even if OCR were to give you correct characters, your viewer could have converted it to display it. If you are accessing text result programatically, that is less of an issue because you are supposed to get a proper subscript character value when accessing it directly. Just note that viewers must support it for you to actually see it. If you eliminated this possible post-processing conversion and made sure that no subscript is returned from OCR, then it probably does not support it.
Just like in this text box, in your original question you tried to give us a superscript character example, but this text box did not accept it even though you could copy/paste it from elsewhere.
Many OCR will see subscript as any other normal character, if they can see it at all. OCR of your use needs to have technical capability to actually produce superscripts/subscripts, and many of them do, but they tend to be commercial OCR systems not surprisingly.
I made a small testcase before answering this letter. I generated an image with a few superscript/subscript examples for my testing (of course EMC2 was the first example that came to mind :) .
You can find my test image here:
www.ocr-it.com/documents/superscript_subscript_test_page.tif
And processed this image through OCR-IT OCR Cloud 2.0 API using all default settings, but exporting to a rich text format, such as MS Word .DOC.
You can find my test image here:
www.ocr-it.com/documents/superscript_subscript_test_page_result.doc
Also note: When you are interested to extract superscript/subscript characters, pay separate attention to your image quality, more than you would with a typical text. Those characters are tiny and you need sufficient details and resolution to achieve descent OCR quality. Even scanned at 300 dpi images sometimes have issues with tiny characters due to too few pixels. If you are considering mobile and digital cameras, that becomes even more important.
DISCLOSURE: My specialty is implementing internal OCR solutions for companies of different sizes. My company is WiseTREND. Contact me directly if I can assist with anything further.