Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: localizing in Russian without unicode

  1. #1

    localizing in Russian without unicode

    Hi,

    is it possible? I'm using D3D fonts by the way, but I would need true type font which has cyrillic chars AND are not unicode.
    http://www.birth-of-america.com/
    <br />The game on American War of Independence and French-Indians war.

  2. #2

    localizing in Russian without unicode

    Sure, you need a font which supports ISO 8859-5 encoding.

    http://www.google.com/search?client=...UTF-8&oe=UTF-8

    ... gives many results.

  3. #3

    localizing in Russian without unicode

    ok, but if I fetch some TTF without unicode, with Cyrillic, how do I proceed? Does the localizing person has to type in cyrillic, or in western alphabet, and then Direct3D will display the right chars by mapping the western chars to the cyrillic chars?

    i'm confused.
    http://www.birth-of-america.com/
    <br />The game on American War of Independence and French-Indians war.

  4. #4

    localizing in Russian without unicode

    ISO 8859-5 has the Cyrillic characters in [#160..#255], so there is no conflict with Western characters. Afaik Windows has separate functions for 8- and 16-bit characters. If you use the 8-bit functions, and the system locale is set to the right values, Windows should automatically return input and output in ISO 8859-5.

  5. #5

    localizing in Russian without unicode

    Can I ask why you do not want to use Unicode?

    There are some easy to use, drop in replacements of Delphi's components called TNT Controls which are free and support Unicode, if that is what is worrying you. I have used TNT Controls in 2 projects now and they work wonderfully.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  6. #6

    localizing in Russian without unicode

    What do you mean by "I'm using D3D fonts by the way"? Can you describe it in more details (as there are a lot of realsations of font rendering in D3D)?

    Standart cyrillic charset for Windows is win-1251. This is single byte charset with cyrillic chars encoded in upper (128-255) part of table. So, localizing person could type them in cyrillic, save text without formatting and this text can be pasted in Delphi IDE (but will look strange on your system).
    There are only 10 types of people in this world; those who understand binary and those who don't.

  7. #7

    localizing in Russian without unicode

    Quote Originally Posted by savage
    Can I ask why you do not want to use Unicode?

    There are some easy to use, drop in replacements of Delphi's components called TNT Controls which are free and support Unicode, if that is what is worrying you. I have used TNT Controls in 2 projects now and they work wonderfully.
    because I'm not using controls. All my text is manipulated with the string variable type and TStringList class, and is then rendered with D3D. I don't feel like adapting the whole app to use widestring variable type. Also I would need a unicode compliant TStringList.
    http://www.birth-of-america.com/
    <br />The game on American War of Independence and French-Indians war.

  8. #8

    localizing in Russian without unicode

    Quote Originally Posted by Clootie
    What do you mean by "I'm using D3D fonts by the way"? Can you describe it in more details (as there are a lot of realsations of font rendering in D3D)?
    this one (made by you ):

    //-----------------------------------------------------------------------------
    // Name: DrawText()
    // Desc: Draws 2D text
    //-----------------------------------------------------------------------------
    function CD3DFont.DrawText(x, y: Single; dwColor: DWORD;
    strText: PChar; dwFlags: DWORD): HRESULT;

    Standart cyrillic charset for Windows is win-1251. This is single byte charset with cyrillic chars encoded in upper (128-255) part of table. So, localizing person could type them in cyrillic, save text without formatting and this text can be pasted in Delphi IDE (but will look strange on your system).
    Ok, so I get a true type font with charset 1251 and use it in my app, creating the 3DFont with:

    CD3DFont.Create(strFontName: PChar; dwHeight, dwFlags: DWORD);

    (your code too)

    The localizing person type cyrillic, but save it in plain ANSI and not unicode.

    And that's all?

    A question by the way, XLS is not able to save cyrillic except in unicode, do you know a workaround? (My localization file is a XLS file, saved in CSV).
    http://www.birth-of-america.com/
    <br />The game on American War of Independence and French-Indians war.

  9. #9

    localizing in Russian without unicode

    Quote Originally Posted by Pocus
    And that's all?

    A question by the way, XLS is not able to save cyrillic except in unicode, do you know a workaround? (My localization file is a XLS file, saved in CSV).
    That is all.

    Regarding Excel, is your Windows system configured for the right code page? (Open the Control Panel -> regional settings -> "Set default..".

  10. #10

    localizing in Russian without unicode

    Yea, it looks good. But you will need to verify it with real font you've got, cos I'm unsure about behaviour in case if Windows system locale is set to charset different from cyrillic.

    But actually looking at source code I see:
    [pascal]function CD3DFont.PaintAlphabet(hDC: Windows.HDC; bMeasureOnly: Boolean{$IFDEF SUPPORTS_DEFAULTPARAMS} = False{$ENDIF}): HRESULT;
    ...
    // For each character, draw text on the DC and advance the current position
    for c := #32 to #126 do
    begin
    ...
    [/pascal]
    So you'll have a problem here - at least you need to change #126 to #255.

    Later you'll have couple of places with something like (that should be updated too):
    [pascal] if ((Ord(c)-32) < 0) or (Ord(c)-32 >= 128-32) then Continue;
    [/pascal]

    So actually I would recommend you to render text using ID3DXFont from recent D3DX9 libraries with unicode strings.


    As for XLS - if your file contains localization strings for different laguages (common western subset, cyrillic, arabic, etc.) - I don't thinks it's possible so save it correctly with one command. If it contains only single language when best route IMHO is to set system locale to match exposted language before saving file as CVS (then Excel should flatten file to single-byte char sequence if possible)[/pascal]
    There are only 10 types of people in this world; those who understand binary and those who don't.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •