Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "unicode range"
-
During a code review I was doing the dev wrote a function that takes a tweet, iterates over each letter, if the letter is not in a specified unicode range the letter is removed from the sentence. So now you have a sentence with missing letters... Wtf1
-
Question for Droid gurus here.
Is there any way to use different fonts in android for different languages ?
I have changed ttf to add urdu fonts but then I'm seeing boxes instead of emoji and symbols. Can I add it to urdu only.
On web we have CSS unicode-range in @font-face which sets a boundary for different fonts to be used for different unicode characters/ranges.
Can this be done in android system some way ?
I'm not talking about using it in an app but in whole droid.1 -
Fuck those weird encoding issues with Python! I've read the HowTo Unicode 10 or 20 times and I still got those 'ordinal not in range error'!!!2
-
I'm creating a bitmap font right now and wanted to automatically generate a image with some text so I can track my progress how it looks. gnome-font-viewer displays it fine, but it'd nothing compared to some real text. Well, how hard can it be?
First attempt: Use ImageMagick to create an image and draw some text. I found a forum post in the ImageMagick forums from 2017 claiming incorrect rendering of BDF fonts, which was promised to be fixed. Yet convert does exactly nothing besides saying “couldn't read font”.
Looking around, there is exactly one tool for the job I'm looking to get done: pbmtext. It works, but doesn't support Unicode. Egh.
Maybe I could write a short script to do it, then? Python's Pillow can import Bitmap fonts (cairo can't). Halfway done I notice it can't deal with anything outside of the character range 0..256.
Using FreeFont directly is out of the question as that seems to be equally much work as creating the font in the first place. I briefly tried SDL, but the font formats it understands are limited.
So how about converting the font then, you ask? Everyone seems to be only concerned about the other way (like OTF to BDF). I tried loading the font into FontForge and exporting an OTF or TTF but couldn't get anything out of it that ImageMagick recognizes as a font.
It seems fucking impossible to render text to an image with an Unicode BDF font in some automated way.
To add insult to injury, my searches containing “bdf” are always interpreted as with “pdf”. I'm not even a Franconian, I can distinguish B and P!4