In the hopes that this question will not be marked as duplicate since all of these only have Windows solutions:
How can I temporarily load a font
Embedding a font in Delphi
How to use external fonts?
My question is this: How can one do the same without using AddFontMemResourceEx, since it's Windows only, under a Linux OS?
On a side note, for the OSX crowd, this question might help.
Related
I tried to fix font rendering on my Debian 8 computer and with this instructions (http://forums.debian.net/viewtopic.php?f=16&t=88545) i installed infinality. So it helped and now I get much smoother fonts but there is one big problem, font named Lato is completely broken. Look.
This is not a big problem, but this font is used literally everywhere in the web. And this problem not only in firefox, but in whole system. How to fix it? Or I should remove infinality?
infinality is designed to mimick a very specific font rendering found on windows systems. Because MS developed this rendering with a specific font set, it does not work on any random font, since it is designed to hide bugs in windows fonts and windows fonts are designed to hide bugs in windows rendering (that's the problem when you develop code and fonts at the same time).
The default Linux rendering is much more font-agnostic but it is anathema to anyone coming from Windows or OSX (for radically different reasons).
It is useless to explain to any user that the text rendering he is used to is not the alpha et omega, and there are enough ex-windows people they've pushed infinality to the top of the charts
Trying to utilize TTFs for image rendering. I didn't have any on the Linux box the application sits; I was at a loss and took a shot in the dark by SCPing the TTFs from my local machine to the server and pointing the application to them. I figured this wouldn't work since my machine is Windows, and box is Linux....but it was a shot in the dark. Alas, it didn't work. My question is: Are TTFs OS and OS Architecture specific?
No. They are plain data files, and data files are not OS specific (although their use may be).
The one single exception I can think of is that in the Bad Old Days, Apple's native file storage format on the Macintosh used two different disk objects: one for 'code' and one for 'data'. Without special software, only the 'code' parts could seen on other computers, leading to a swift exorcism of this storage format when Apple realized the rest of the world had problems reading their files. Still, it's far from unusual to read messages of confused people, finding that extracting an old Mac zip file can result in lots of zero-byte files.
As for your problem: since the problem does not lay in the font file format (there is no reason TTF "cannot work" on your system), it should be either the software you are using (does it actually support TTF fonts?) or - and I consider this more likely - you made an error transferring the files and you ended up with damaged fonts.
I can get the list of available printer fonts by calling Delphi's TPrinter methods which I believe in turn calls Windows GDI (such as CreateFontA() ?). I do this in WINE running in Debian. I do not know why, but luckily this list contains true type font names, which I need most but are not shown by command xlsfonts. I am not sure if this is relevant to the technology under the hood, but package CUPS is installed.
This successful experience makes me to think that WINE must in turn call some Linux API (X, xfs, ...?) and then provide my program the results I want.
Now I would like to get the same list directly from Linux in C or C++. Which way should I take in order to achieve this goal? What API documentations should I study?
WINE font inspires me a lot, but I decide to stop researching the solution for my own question as the technology required to retrieve printer fonts in X window seems to be not trivial. I choose to use the font list given by Delphi's TPrinter running in WINE instead.
I close this question.
I am looking for a way to change the keyboard layout from within my Qt application. The application will run on a Linux kernel that doesn't support keyboard layout files, so Qt has to do everything concerning the mapping of the keyboard input.
In case of Qt for Embedded Linux I have found a good-looking solution here:
Qt Embedded for Linux. Keyboard layout switching
But unfortunately the QKbdDriverFactory class is not available for any other Qt versions, according to the documentation here: http://qt-project.org/doc/qt-4.8/qkbddriverfactory.html
I tried including it anyway (and astonishingly the class was there), but the compiler throws "undefined reference" errors whenever I invoke the create function.
Do I have to manually program huge QMap objects? Please tell me that there's a less tedious way. I don't want to believe that the qmap files can't be used outside of Qt for embedded Linux, because why would the kmap2qmap converter be available in practically any SDK if it's useless most of the time?
Alex
edit: Additional information:
I am using Qt 4.7.4 (32 Bit) and QtCreator 2.4.1.
I work on Ubuntu 12.04, 64 Bit on a Virtual Machine.
The target system is a hardware with a specialized minimal Linux kernel, so trying to use Qt Embedded would be very difficult.
There is no Xcb server, no frame buffer plugin (edit2: But we do use a frame buffer) and I couldn't find out what DE or eglfs means.
Seems like you should implement your own keyboard support layer.
You don't have dumpkeys program, so you can't generate keymap files on device. Use desktop version.
Keycodes generated on desktop PC might be different from keycode generated by your device, so you should adapt them.
After adapting keymap files you can write code to read these files.
Having a map of KEY_CODE=>UTF8_CHARACTER you can intercept key events and translate them to input symbols, according to currently used keymap.
How font rendering is done in linux, bsd, windows? how they differ?
I am not talking about browser web font rendering.say for example how input system works? I press mouse keys. they trigger evdev drivers of linux kernel, and the kernel manages the higher level ops.
low level font rendering mechanism. how freetype, pango, window manager, interact with each other. another big question? how unicode support is accomplished??
simply, when I type a character in a text editor, what are the paths does the character flow before coming into the screen. how the MS word or LibreOffice render different fonts together in single canvas??
On *nix text-rendering is done client-side nowadays which means apps use whatever lib they like best to transform unicode codepoints to pixels and feed the result to x. The actual libs used wary widely though people has been converging on fontconfig + freetype + freebidi + harfbuzz in the past years, usually accessed through pango-cairo
A summary was posted here a few years ago
http://behdad.org/text/
It's all a devilishly complex process, you have weeks of reading if you want to understand all the steps involved.
text-rendering linux fonts