Page 1 of 1

how to get inter-character spacing ??

PostPosted: Sun Nov 22, 2009 12:31 pm
by kevin Feng
hi all,
Is anybody know how to get the inter-character spacing between the regions of the Latin text and the regions of the
East Asian text in a paragraph.
I know the spacing is adjusted automatically.

for example:
Code: Select all
我 wo.

so the center spacing how can I get??

thanks.

Re: how to get inter-character spacing ??

PostPosted: Mon Nov 23, 2009 1:36 am
by jason
I'm sure there are people using docx4j who have more experience with this than me, but to get the ball rolling ...

The relevant setting may be autoSpaceDE [1]. There is also autoSpaceDN, and docGrid [2].

You can get the value from PPr:

Code: Select all
ppr.getAutoSpaceDN()


The result is a BooleanDefaultTrue.

Is that what you are after, or an actual number? (If a number, what do you want to do with it?)

The actual number is UA specific ie the spacing that Word renders in the document is up to their layout algorithm. Web browsers will also do something similar - the equivalent CSS property is text-autospace. There is no equivalent in XSL FO.

docx4j doesn't currently have a layout algorithm.

[1] http://www.documentinteropinitiative.or ... 6f299.aspx
[2] http://openiso.org/Ecma/376/Part4/2.6.5

Re: how to get inter-character spacing ??

PostPosted: Mon Nov 23, 2009 4:00 am
by dqkit
I have also read the that many times in Open XML SDK document. and it says:
2.3.1.2 autoSpaceDE (Automatically Adjust Spacing of Latin and East Asian Text)

This element specifies whether inter-character spacing shall automatically be adjusted between regions of Latin text and regions of East Asian text in the current paragraph. These regions shall be determined by the Unicode character values of the text content within the paragraph.

......

the last setence up there says "These regions shall be determined by the Unicode character values of the text content within the paragraph." . I didn't get it. does it means the space-width between Latin and East Asian Text is the value of the Unicode character? say, i has the value of 105 ?
or is there a fixed space-width between Latin and East Asian Text?
Puzzling...
--Kit

Re: how to get inter-character spacing ??

PostPosted: Mon Nov 23, 2009 4:53 am
by kevin Feng
Is that what you are after, or an actual number? (If a number, what do you want to do with it?)

Actually I want to get the actual number because I really need to know the length of a sentence which
contain some East Asian text and some Latin text.

Re: how to get inter-character spacing ??

PostPosted: Mon Nov 23, 2009 6:28 am
by jason

Re: how to get inter-character spacing ??

PostPosted: Sat Nov 28, 2009 12:07 am
by dqkit
yeah, it helps a lot. Thanks a lot, jason.
but, It seems Microsoft has more complicated than that....
orz...