LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Replacing all chars "ё" at screen to "ö" (https://www.linuxquestions.org/questions/linux-desktop-74/replacing-all-chars-at-screen-to-%F6-849805/)

Nordman 12-12-2010 06:08 PM

Replacing all chars "ё" at screen to "ö"
 
I need to change all symbols (for example "ё", i know its unicode) to another (for example "ö", i also know its unicode) befor output to XWindow's screen.

Should I patch freetype2, cairo, pango or Xft2?
Or is enough to add some lines to /etc/fonts/fonts.conf?

How can I replace char code before rendering in font's subsystem?

JZL240I-U 12-13-2010 02:40 AM

Why don't you pipe the symbols to "sed" and from there to your screen?
Code:

man sed
What is your "output" what application runs in Xwindows?

MTK358 12-13-2010 01:02 PM

Why do you want to do this?

Nordman 12-14-2010 05:04 AM

The elaboration of aim
 
Sed is util for transforming some files.
But I need to transley ALL OUTPUT to the screen!

I want to make transliteration all cyrillic (russian) letters to latin letters on the fly,
on all desktop output of all X-applications.

I know I should hack font render mechanism or to change mapping table (map screen).
How can I do it?

JZL240I-U 12-15-2010 01:33 AM

Wouldn't this be the same as setting the system fonts to cyrillic?

Nordman 12-15-2010 11:27 AM

I want to exchange the system char mapping for all fonts by one patch. I don't want to edit each font file. It's inconceivable.

JZL240I-U 12-16-2010 01:25 AM

As I understand it there is no need for patching. You can install linux with a cyrillic character set from the beginning or you can change that later. "Localization" is what I mean.

Nordman 12-16-2010 05:33 AM

You don't understand me right.
There is russian localisation already at my computer.
There are russian symbols at my screen now.
But I want to change russian symbols to latin's.

jschiwal 12-16-2010 11:08 AM

What you want to do would require more than system changes, as they go beyond locale changes and font definitions.

The `ё' character is never used except in dictionaries. It is a pronunciation guide. So the 'e' would be the same printed character, that you want to sometimes print as 'e' and sometimes as 'ö' depending on the word.

Many characters would be translated to character sequences on latin. ц->ts щ->chsh ш->sh ч->ch.

You would literally be inventing your own language, and need to translate the documents and patch the text in programs.

About the best you could do, AFAIK, is create your own .po files for applications that use gettext to translate text at runtime.
Code:

eg: from
msgid "\tUsers allowed:\n"
msgstr "\tРазрешенные пользователи:\n"

to:
msgid "\tUsers allowed:\n"
msgstr "\tRazreshenye polzovateli\n"

If there was a main .po file of set phrases that programs used, this might be practical, but you would need to do this for each program. This assumes that the program isn't built for a particular domain and the .po files are located in the source. E.G. for the VLC project, the "previous" menu item in the /po/ru.po file:
Code:


#: modules/gui/qt4/menus.cpp:857
msgid "Pre&vious"
msgstr "Предыдущий"

You would need to change msgstr to "Prediduchshiy". Only 6758 entries to go. And this is for one program.

Nordman 12-16-2010 11:48 AM

Glyphs remap
 
Goooood!... Nobody understand me!

I don't want to change any localizations. I don't need to correct some ".po".
I NEED TO CHANGE THE VIEW OF ALL OUTPUT CHARS.

I need to remap font system so that glyphs of russian charset will chenged to latin's glyphs.
The result will be new view of all cyrillic symbols (other glyphs) in all programs, for example, in each page on browser.

P.S. Sorry my English, I'm still learning it :)

Nordman 12-16-2010 11:59 AM

Quote:

Originally Posted by MTK358 (Post 4190050)
Why do you want to do this?

I hope it will good for studying English if latin will become my native alphabet.

MTK358 12-16-2010 12:24 PM

I don't really know, but aren't there many separate ways programs can draw fonts?

If so, there probably isn't hope of modifying each and every one.

jschiwal 12-16-2010 01:17 PM

There isn't a one to one correlation between russian and latin glyphs.

It would be easier to learn the latin alphabet than invent your own locale and code pages, resulting in partially transliterated gibberish.

For partial transliterated encoding changes, perhaps read /usr/share/X11/doc/fonts/fonts.pdf.
There is a short paragraph on adhoc encoding changes, which points out a file which does it. This maps a character to a different glyph.

JZL240I-U 12-17-2010 12:57 AM

* bows with envious regret to linguistic knowledge of jschiwal *

There is never enough time to learn all (the languages) one would like to learn.

jschiwal 12-17-2010 01:13 AM

JZL240I-U:

Being a Geek, I tried to teach myself Russian in 1992. But that was a long time ago.


All times are GMT -5. The time now is 03:35 PM.