windows - Display of Asian characters (with Unicode): Difference in character spacing when presented in a RichEdit control compared with using ExtTextOut -


this picture illustrates predicament:

image1

all of characters appear same size, space between them different when presented in richedit control compared when use exttextout.

i present characters same in richedit control (ideally), in order preserve wrap positions.

can tell me:

a) which more correct representation?

b) why richedit control displays text no gaps between asian characters?

c) is there way make exttextout reproduce behaviour of richedit control when drawing these characters?

d) would different if working on asian version of windows?

perhaps i'm being optimistic, if has hints offer, i'd interested hear.

in case helps:

here's text:

快的棕色狐狸跳在懶惰狗1 2 3 4 5 6 7 8 9 0 

apologies asian readers, merely testing our unicode implemetation , don't know language characters taken from, let alone whether mean anything

in order view effect pasting these characters richedit control (eg. wordpad), may find have swipe them , set font 'arial'.

the rich text obtain is:

 {\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl{\f0\fnil\fcharset0 arial;}}{\colortbl ;\red0\green0\blue0;}\viewkind4\uc1\pard\sa200\sl276\slmult1\lang9\fs22\u24555?\u30340?\u26837?\u33394?\u29392?\u29432?\u36339?\u22312?\u25078?\u24816?\u29399?1 2 3 4 5 6 7 8 9 0\par\pard\'a3 $$ \'80\'80\cf1\lang2057\fs16\par} 

it doesn't appear contain value character 'pitch' first thought.

i don't know answer, there several things suspect:

  • there several versions of rich edit control. perhaps you're using older 1 doesn't have latest typographic improvements.
  • there many styles , flags affect behavior of rich editcontrol, might want explore ones set , do. example, @ em_geteditstyle.
  • many asian fonts come in 2 versions on windows. 1 optimized horizontal layout, , other vertical layout. latter has same name, has @ prepended it. perhaps using wrong 1 in rich edit control.

update: messing around wordpad, able reproduce problem crowded text in rich edit control.

  1. open new document in wordpad on windows 7. note selected font calibri.
  2. paste sample text document.
  3. text appears correct, wordpad changed font simsun.
  4. select text , change font calibri or arial.

the text overcrowded, similar example. appears fundamental problem font linking , fallback. exttextout selecting appropriate font script automatically. challenge figure out how identify right font script , set font in rich edit control.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -