2014-03-06 18 views

回答

1
REBOL [ 
    title: "chinese font rendering test (Windows)" 
    author: "Richard Smolak" 
] 
load-gui 
print "" 
fnt: make system/standard/font [ 
    name: "Tahoma" 
    size: 64 
] 

ch-fnt: make system/standard/font [ 
    name: "SimSun" 
    size: 64 
] 

par: make system/standard/para [wrap?: off] 

win-size: 840x300 

append append 
win: make gob! [size: win-size] 
make gob! [size: win-size color: sky] 
tg: make gob! [size: win-size] 

tg/text: to-text compose [ 
    anti-alias on 
    para par 
    font fnt 
    "Příliš žluťoučký kůň" 
    newline 
    font ch-fnt 
    "這是一份非常間單的說明書…" 
    newline 
    "這是一份非常間單的說明書…" 
] copy [] 


view/options win [ 
    title: "Basic TEXT test" 
    offset: 'center 
] 

是渲染其他語言的r3Gui作者之一的例子。

+0

感謝您爲我縮進:) –

+0

非常感謝,:) – abbypan

1

您可以使用像這樣的中文字體創建一個新的字段類型,它將顯示字符。

stylize [ 
     ch-field: field [ 
       about: "Chinese font field" 
       draw-text: [ 
        pen off 
        fill-pen 0.0.0 
        anti-alias off 
        text 0x0 none aliased [font make object! [ 
          name: "SimSun" 
          style: 'bold 
          size: 20 
          color: 0.0.0 
          offset: 0x0 
          space: 0x0 
          shadow: none 
         ] para make object! [ 
          origin: 0x0 
          margin: 0x0 
          indent: 0x0 
          tabs: 40 
          wrap?: false 
          scroll: 0x0 
          align: 'left 
          valign: 'top 
         ] anti-alias off 
         caret make object! [ 
          caret: [[""] ""] 
          highlight-start: [[""] ""] 
          highlight-end: [[""] ""] 
         ] "" 
        ] 
       ] 
     ] 
] 

view [ 
    ch-field "這是一份非常間單的說明書…" 
] 

由於剪貼板的問題,您不能將中文文本粘貼到該字段中。希望這個問題很快就會解決。