Announcement

Collapse
No announcement yet.

Limited Chinese Character Set

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
    Walt Thompson
    Member

  • Walt Thompson
    replied
    That's very interesting - but what does it all mean?
    I don't know, its all Chinese to me.

    BTW Thanks for the suggestion. I'll use it the final project.

    Leave a comment:

  • Walt Thompson
    Member

  • Walt Thompson
    replied
    BTW. What did you use to create the .ttf file?
    Hi Dave;

    I used Font Creator 5.5.

    Leave a comment:

  • Jules Marchildon
    Member

  • Jules Marchildon
    replied
    For non-PB9 upgrades... (replace FONT NEW , CONTROL SET FONT)
    Code:
    #INCLUDE "PBFORMS.INC"
    ...
    sFontFile = "C:\PowerBasic\PBWin80\Samples\Test_Samples\LimitedChineseCharacterSet.ttf" '<-change to your path
    lRslt = AddFontResource(BYVAL STRPTR(sFontFile))
    hFont = PBFormsMakeFont("LimitedChineseCharacterSet",14,%FW_NORMAL,%FALSE,%FALSE,%FALSE,%DEFAULT_CHARSET)
    CONTROL SEND hDlg,%Char1,%WM_SETFONT,hFont,%TRUE
    ...
    IF ISTRUE(hFont) THEN DeleteObject hFont
    RemoveFontResource( BYVAL VARPTR(sFontFile))

    Leave a comment:

  • Dave Biggs
    Member

  • Dave Biggs
    replied
    That's very interesting - but what does it all mean?

    If you add these lines to the source code you don't need to have the font installed - just in the same folder as the exe.
    Code:
        [COLOR=gray]LOCAL  CpageCur     AS DWORD[/COLOR]
     
        STATIC sFontFile    As String
        STATIC hFont        As Dword
     
        sFontFile = "LimitedChineseCharacterSet.ttf" '<- from file
        lRslt = AddFontResource(BYVAL STRPTR(sFontFile))
        SendMessage(%HWND_BROADCAST, %WM_FONTCHANGE, 0, 0)
     
        [COLOR=gray]DESKTOP GET CLIENT TO ClientX, ClientY[/COLOR]
        ...
        [COLOR=gray]DIALOG SHOW MODAL hDlg, CALL ShowDlg TO lRslt[/COLOR]
     
        DeleteObject hFont
        RemoveFontResource( BYVAL VARPTR(sFontFile))
     
    [COLOR=gray]END FUNCTION[/COLOR]
    (I believe you could include the font as a resouce too. RDATA perhaps?).

    BTW. What did you use to create the .ttf file?

    Leave a comment:

  • Walt Thompson
    Member

  • Walt Thompson
    started a topic Limited Chinese Character Set

    Limited Chinese Character Set

    I found that limited number of Chinese character could be assigned to the single byte addresses used by standard ASCII characters. Obviously, this technique is useless for preparing Chinese texts. However, it works OK when you need a limited number of characters for GUI labels.

    Sample code titled Limited Chinese Character Set is posted in the Source Code forum.
Working...
X