locked
Aligning English and Japanese Characters RRS feed

  • Question

  • I am using Visual C++ to align the text of strings which often consist of different fonts. The first part of each string consists of numerals. The second part of the string consists of Japanese characters and the third part consists of English characters.

    These changes in fonts cause vertical alignment to be difficult. I need a method to ensure proper verticle alignment of the English portion of each string. In other words, I want to change this:

    3.1.3.1    CPC コネクタ                                                                     UNTESTED  UNTESTED 

    3.1.4.2    バッテリチャージ                               (80 to 100 %)                UNTESTED  UNTESTED 

    3.1.6.4    VGA 出力試験                                                                        UNTESTED  UNTESTED 

    3.1.8.4    ビデオオーバーレイ試験(図4                                                    UNTESTED  UNTESTED 

    3.1.9.3    MP3                                                                               UNTESTED  UNTESTED 

    3.1.10.1   CPUバッテリ交換                                                           UNTESTED  UNTESTED

    Into this:

    3.1.3.1    CPC コネクタ                                                                     UNTESTED  UNTESTED 

    3.1.4.2    バッテリチャージ                               (80 to 100 %)                       UNTESTED  UNTESTED 

    3.1.6.4    VGA 出力試験                                                                     UNTESTED  UNTESTED 

    3.1.8.4    ビデオオーバーレイ試験(図4                                                         UNTESTED  UNTESTED 

    3.1.9.3    MP3                                                                            UNTESTED  UNTESTED 

    3.1.10.1   CPUバッテリ交換                                                                   UNTESTED  UNTESTED

    I am using Visual C++ 6.0. I am trying to print the strings into a Word document.

    I want to implement a method that will count the number of twips between each part of string before it is printed out.

    Is there a GDI function that I can use to determine the width of each Japanese character before it is printed out?

    Thanks,

    Taurus64

    Tuesday, July 24, 2012 2:33 AM

Answers

  • Taurus64 wrote:

    Is there a GDI function that I can use to determine the width of each  Japanese character before it is printed out?

    GetTextExtentPoint32


    Igor Tandetnik

    • Marked as answer by Elegentin Xie Tuesday, July 31, 2012 7:28 AM
    Tuesday, July 24, 2012 4:03 AM