tag:blogger.com,1999:blog-51470969772160884392024-03-19T11:34:01.629+08:00The World Is FlatFong Linhttp://www.blogger.com/profile/03182572595236719782noreply@blogger.comBlogger17125tag:blogger.com,1999:blog-5147096977216088439.post-13601284916957739782009-07-30T14:48:00.002+08:002009-07-30T14:50:29.810+08:00Hackweek<a title="Taobao" href="http://www.taobao.com/" id="u47-">Taobao</a> is a biggest online retail marketplace for consumers in China. Founded by parent Alibaba Group, it facilitates transactions between individual consumers and a wide range of sellers such as retailers, wholesalers, and other individuals. Similar to eBay, sellers are able to post new and used goods for sale on the Taobao marketplace either through a fixed price or negotiated sale or by auction. Primary competitors include eBay, yet reports have shown that Taobao has over 80% of the C2C market in China.<br /><br />It was hackweek in Novell last week. I decided to make a Taobao extension in OpenOffice.org to facilitate Taobao users manager their transaction data including what they bough and what they sold. So that it could attract more people to use OpenOffice.org for it is reported that Taobao has over 100 million users in China. :-)<br /><br />Firstly, I need to learn the <a title="Taobao Open Platform(TOP)" href="http://open.taobao.com/" id="lzti">Taobao Open Platform(TOP)</a> which provides API to manager the business in Taobao. I wrote some example to learn how to use these API to get the transaction data of the user's bough and sold.<br /><br />Secondly, I also need to spend some time learn how to make an extension in Java. And I found some examples to see how to make a custom menu and dialog in Openoffice.org SDK.<br /><br />Finally, I got a prototype that could import the transaction data from Taobao into Spreadsheet.<br /><div id="sbp6" style="text-align: left;"><div id="eihx" style="text-align: left;"><img style="width: 600px; height: 98px;" src="http://docs.google.com/File?id=dhk62h9x_296fmtxf9f9_b" /></div><br /></div>See the above sceenshot, a custom menu "Taobao" is added into Calc.<br />When "Taobao"->"Buy" is click, your bough data is imported in the spreadsheet.<br /><div id="zm_k" style="text-align: left;"><img style="width: 607px; height: 434px;" src="http://docs.google.com/File?id=dhk62h9x_297hqzmr4zs_b" /></div><br /><br />Actully, this is just a demo, not a final version. I will improve this extension and upstream the codes and binary extension into Google project <a title="oootaobao" href="http://code.google.com/p/oootaobao/" id="sru9">oootaobao</a>.Fong Linhttp://www.blogger.com/profile/03182572595236719782noreply@blogger.com0tag:blogger.com,1999:blog-5147096977216088439.post-14412639612666196072008-12-08T15:57:00.002+08:002008-12-08T15:57:40.263+08:002008-12-05* Update early, try to make vba for word work. dump the vbaapi.db and the Global interface is included in this db too. Compared the implementation of XGlobal between word and excel, find that SwVbaGlobals::getGlobalsImpl is missing. Add this function and build again. Success to run Application.Name(). Congratuation!!<br /><br />* Update to dev300-m36<br /><br />* Start to have a look at where to add an option for word macro import for Tools|Options|Load Save|VBA Properties| Executable code ( currently the patch just hard codes executeable code ). Like an option for excel macro import. ( Supposed it is a copy&paste task :-) )Fong Linhttp://www.blogger.com/profile/03182572595236719782noreply@blogger.com0tag:blogger.com,1999:blog-5147096977216088439.post-64723880285731162422008-12-08T15:43:00.002+08:002008-12-08T15:44:42.362+08:00A Simple Word VBA MacroWe Novell OOo team start to work on VBA for word support. Our first simple Word macro is running.<br /><br /><div id="u1b5" style="padding: 1em 0pt; text-align: left;"><img src="http://docs.google.com/File?id=dhk62h9x_237gxcktvf9_b" height="709" width="887" /><br /><br />We also add a UI option in Tools -> Options -> Load/Save -> VBA Properties -> Executable code, to indicate whether the VBA macros are imported without comments to be executable.<br /><br /><div id="u535" style="padding: 1em 0pt; text-align: left;"><img style="width: 833px; height: 442px;" src="http://docs.google.com/File?id=dhk62h9x_239f77j39f2_b" /></div><br />Definitely, we have many things need to do. The first thing, I think, is about how to share the code with VBA for Excel.<br /></div>Fong Linhttp://www.blogger.com/profile/03182572595236719782noreply@blogger.com1tag:blogger.com,1999:blog-5147096977216088439.post-2087213031775899452008-12-03T22:53:00.002+08:002008-12-03T22:55:16.940+08:002008-12-03* update the ooo-build to dev300-m36. I started to build dev300-m36 last night. When I came back this morning, found that some package were missing. For I just updated my system to SLED11 beta5, it seems these packages are removed when the system is updated. I had to install the missing packages again. It took me about 1hours to make the new build continue.<br /><br />* Great to hear that Redflag 2000 guy Wanglibing wanted to start port new vba api. Answer his mail. Hope he can warm up quickly.<br /><br />* Accept Noel's suggestion to start a new build based on dev300-m35 in another system for it is verified to use well.<br /><br />* Overview the commandbar stuff. I am annoyed by the codes, ( seems not much better to port it from helperapi directly. had better to re-invent the wheel :-). Anyway, after some modification, some common issuees are fixed. and more common apis are added too.<br /><br />Current existing problems:<br /><br />1) Regarding commandbar stuff, the main difference between MS Office and OOo is that MS Office treats commandbar as toolbar ( main menu is a toolbar named "Worksheet Menu Bar" in Excell ), while OOo treats commandbar as menu and toolbar. The url of menu is "private:resource/menubar/menubar" for build-in menus or "vnd.openoffice.org:CustomMenu" for customize menus. The url of toolbar is "private:resource/toolbar/" for build-in toolbars or is "private:resource/toolbar/custom_toolbar_***" for customize toolbars. In MSO, you can create customize toolbars in "tools->customize". In OOo, you can create customize menu/toolbar in "Tools->Customize". The related codes of the customize dialog is located in svx/source/dialog/cfg.cxx.<br /><br />2) Confused with CommandBars("File") & CommandBars(1).Controls("File")<br />* CommandBars("File") returns a CommandBar object which type is msoBarTypePopup.<br />* CommandBars(1).Controls("File") returns a CommandBarControl object which type is msoControlPopup.<br /><br />It seems they are referenced to the menu "File"<br /><br />Note they are not supported in OOo VBA yet.<br /><br />3) Currently OOo VBA only supports CommandBarControl, and doesn't support CommandBarPopup and CommandBarButton. In MSO both CommandBarPopup and CommandBarButton are common used. It is better to support them in OOo VBA. Both CommandBarPopup and CommandBarButton are based on CommandBarControl, So the following macro is OK in MSO<br /> <br /> dim cbc1 as CommandBarControl<br /> dim cbc2 as CommandBarControl<br /> dim cbb as CommandBarButton<br /> dim cbp as CommandBarPopup<br /><br /> set cbp = CommandBars(1).Controls.Add( Type:= msoControlPopup )<br /> cbp.Caption = "Popup Menu 1"<br /><br /> set cbc1 = CommandBars(1).Controls.Add( Type:= msoControlPopup ) <br /> cbc1.Caption = "Popup Menu 2"<br /><br /> set cbb = cbp.Controls.Add( Type:= msoControlButton ) <br /><br /> set cbc2 = cbp.Controls.Add( Type:= msoControlButton ) <br /><br /><br />4) I think CommandBarControl.OnAction is an important api which is to set the name of a vb procedure that will run when the user clicks the menu/toolbar. Most of the reasons you create a customize menu/toolbar is to let user to run a vb procedure by clicking the menu/toolbar. <br /> when OnAction is set, it needs to map the name os a vb procedure to a working command url of OOo. e.g.<br /><br />myControl.OnAction = "Macro1"<br /><br /> The name "Macro1" needs to convert to a working command url like: vnd.sun.star.script:Standard.Module1.Macro1?language=Basic&location=document<br /><br />* Meet a couple of breaks when building dev300-m36. To saving time, abandon to build it. and focus to build dev300-m35.<br /><br />* Start to have a look at the patch of vba for word.<br /><br />* Team meetingFong Linhttp://www.blogger.com/profile/03182572595236719782noreply@blogger.com0tag:blogger.com,1999:blog-5147096977216088439.post-54796395423932862112007-09-28T10:59:00.000+08:002007-09-28T11:36:16.160+08:00The progress of CJK functions<p style="margin-bottom: 0cm;"> </p><p style="margin-bottom: 0cm;"><span style=";font-family:Thorndale AMT,serif;font-size:100%;" >Recently in OOoCon 2007, I made a talk about the CJK (Chinese, Japanese and Korean) functions what I have been working on. I think it is better to show the progress to the world. If you have any hot issue about CJK functions, please let me know.</span><span style="font-size:100%;"><br /></span> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >Here is the main CJK functions.</span> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >CJK functions that have been done:</span> </p> <ul> <li> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >Text grid enhancement</span> </p> </li> <li> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >CJK font relevant stuff</span> </p> </li> <li> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >MS Word compatibility options enhancement</span> </p> </li> </ul> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >CJK functions that I am working on:</span> </p> <ul> <li> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >Character/Line measurement unit and ruler</span> </p> </li> <li> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >Paragraph style default settings for CJK</span> </p> </li> </ul> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >CJK functions that I will work on:</span> </p> <ul> <li> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >Punctuation compress</span> </p> </li> <li> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >Bullets and numbering enhancement</span> </p> </li> </ul> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >OK, I will make a summary for each CJK function so that you could get more knowledge. :-)</span> </p> <p style="margin-bottom: 0cm;"> </p><p><span style=";font-family:Thorndale AMT,serif;font-size:130%;" ><b>Text grid enhancement (</b></span><span style="font-size:130%;"><a title="http://qa.openoffice.org/issues/show_bug.cgi?id=76247" href="http://qa.openoffice.org/issues/show_bug.cgi?id=76247" id="anug"><b>i76247</b></a><b>)</b></span></p><p style="margin-bottom: 0cm;"> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >One of the main CJK functions is text grid which is wildly used in CJK environment. For example, Chinese government document must use text grid with 22 lines per page and 28 characters per line.</span> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >However, there are two types of paper mode for text grid. One is </span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" >"</span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" >squared</span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" >"</span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" > paper mode which OOo supports currently, the other is "Standard" paper mode which most CJK versions of office suite (including MS Word) support.</span> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >What's the difference between these two types of paper mode.</span> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >For </span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" >"</span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" >squared</span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" >"</span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" > paper mode, as shown in Figure 1, the page is divided in a fixed numbers of lines , and each line is divided into square cells . The number of lines per page depends on the line height ( i.e., the sum of grid base and ruby height), and the Asian characters per line also depends on the line height.<br /></span> </p> <p style="margin-bottom: 0cm;"> </p><div id="ys:9" style="padding: 1em; text-align: center;"><img style="width: 1152px; height: 555px;" src="http://docs.google.com/File?id=dhk62h9x_70c5znkqgx" /><br /><b>Figure 1. Squared paper mode</b><br /></div><p style="margin-bottom: 0cm;"> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >In this type of paper mode, if we change the </span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" >"</span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" >Lines per page</span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" >"</span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" > setting in the </span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" >"</span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" >Text Grid</span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" >"</span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" > tab page, the type are of the page will be changed. This type of paper mode is only used in limited case. Most CJK users have habit to the “standard” paper mode.</span> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >Figure 2 illustrates the </span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" >"</span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" >Standard</span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" >"</span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" > paper mode. As we can see, the lines per page depends on the base text size, while the characters per line depends on the character width. The ruby text is unavailable anymore. Moreover if the lines per page is changed, the type area is not changed yet.</span></p><div id="n9:i" style="padding: 1em; text-align: center;"><img style="width: 1089px; height: 571px;" src="http://docs.google.com/File?id=dhk62h9x_717t57qxfb" /><br /><b>Figure 2. Standard paper mode</b><br /></div> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >Now, both types of paper mode are supported in ooo-build. In order to ensure only one type paper mode is used in the whole document, as shown in figure 3, a global setting option is provided in Writer tab page (Tools -> Options -> OOo Writer -> General).The codes are also up-streamed which is under QA so far.<br /></span></p><div id="b53q" style="padding: 1em; text-align: center;"><img style="width: 714px; height: 410px;" src="http://docs.google.com/File?id=dhk62h9x_72f3shm3g2" /><br /><b>Figure 3. Global setting option for text grid</b><br /></div> <p style="margin-bottom: 0cm;"> </p><p><span style=";font-family:Thorndale AMT,serif;font-size:130%;" ><b>CJK font relevant</b></span></p><p style="margin-bottom: 0cm;"> </p> <p style="margin-bottom: 0cm;"> <span style="font-size:100%;">There are some issues about CJK font in OOo.</span></p> <p style="margin-bottom: 0cm;"> </p><p><span style=";font-family:Thorndale AMT,serif;font-size:100%;" ><b>Asian font list box ( </b></span><span style="font-size:100%;"><a title="http://qa.openoffice.org/issues/show_bug.cgi?id=73003" id="bufl"><b>i73003</b></a> </span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" ><span style="color: rgb(60, 60, 65);"><span style="font-family:Tahoma,sans-serif;"><b>)</b></span></span></span></p><p style="margin-bottom: 0cm;"> </p> <p style="margin-bottom: 0cm;"> </p><p style="margin-bottom: 0cm;"><span style=";font-family:Thorndale AMT,serif;font-size:100%;" >The Asian font list box in the character property dialog lists all the available fonts even if they are not Asian font in OOo currently. It is better to only list the available CJK fonts. </span><span style="font-size:100%;"><br /></span> </p> <p style="margin-bottom: 0cm;"> </p><div id="z8z1" style="padding: 1em; text-align: center;"><img style="width: 592px; height: 420px;" src="http://docs.google.com/File?id=dhk62h9x_73gp89kqgj" /><br /><b>Figure 4. Asian font list box</b><br /></div><p><span style=";font-family:Thorndale AMT,serif;font-size:100%;" ><b>CJK mess font ( </b></span><span style="font-size:100%;"><a title="http://qa.openoffice.org/issues/show_bug.cgi?id=73003" id="f5gc"><b>i73003</b></a> </span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" ><b>)</b></span></p><p style="margin-bottom: 0cm;"> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >The issue in current OOo is that the selected western font is applied to the CJK text even if the selected western font doesn't support CJK language. So I extend the usage of fontconfig to check whether the selected font supports CJK language before applying the selected font to the CJK text.</span> </p><div id="a:iu" style="padding: 1em; text-align: center;"><img style="width: 581px; height: 386px;" src="http://docs.google.com/File?id=dhk62h9x_74g4v36xjj" /><br /><b>Figure 5. Mess font</b><br /></div><p style="margin-bottom: 0cm;"><span style="font-size:100%;"><br /></span> </p> <p style="margin-bottom: 0cm;"> </p><p><span style=";font-family:Thorndale AMT,serif;font-size:100%;" ><b>Chinese font size (</b></span><span style="font-size:100%;"><a title="http://qa.openoffice.org/issues/show_bug.cgi?id=54603" href="http://qa.openoffice.org/issues/show_bug.cgi?id=73003" id="izt6"><b>i54603</b></a> </span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" ><b>)</b></span></p> <p style="margin-bottom: 0cm;"> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >China has his own unit to measure font size such as </span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" >"</span><span style="font-size:100%;">五号</span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" >"</span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" >. Of course, there is a conversion map between Chinese font size unit and western font size unit.</span></p><p style="margin-bottom: 0cm;"><span style=";font-family:Thorndale AMT,serif;font-size:100%;" ><br /></span> </p><div id="bm07" style="padding: 1em; text-align: center;"><img style="width: 633px; height: 419px;" src="http://docs.google.com/File?id=dhk62h9x_75d5gsswgv" /><br /><b>Figure 6. Chinese font size</b><br /></div><p style="margin-bottom: 0cm;"> </p><p><span style=";font-family:Thorndale AMT,serif;font-size:100%;" ><b>Font substitute (</b></span><span style="font-size:100%;"><a title="http://qa.openoffice.org/issues/show_bug.cgi?id=54603" id="izt6"><b>i54603</b></a> </span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" ><b>)</b></span></p><p style="margin-bottom: 0cm;"> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >The fontconfig library is extended to use to find more suitable font when the desired font is missing. The patch is initialed by Caolan. We make it more better support Chinese.</span> </p> <p style="margin-bottom: 0cm;"> </p><p><span style=";font-family:Thorndale AMT,serif;font-size:130%;" ><b>Microsoft Word compatibility options enhancement (</b></span><span style="font-size:130%;"><a title="i78591" href="http://www.openoffice.org/issues/show_bug.cgi?id=78591" id="pafg"><b>i78591</b></a> </span><span style=";font-family:Thorndale AMT,serif;font-size:130%;" ><b>)</b><br /></span></p><p style="margin-bottom: 0cm;"> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >As we know, in MS Word, there are quite a lot of compatibility options which are used to control layout for different versions.</span> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >Now, OOo only supports a few of compatibility options. Most of them are not handled in WW8 filter, which may cause layout different when do .DOC-> OOo -> .DOC converter.</span> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >Of course, this is a common issue not just for CJK.</span> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >Actually, it is not necessay for OOo to handle all the compatibility options. But in order to improve the interoperability with MS Word, one alternative way is to store the unhandled compatibility options in document model when import a .DOC document, and save them out when export to .DOC document again.</span></p> <p style="margin-bottom: 0cm;"> </p><p><span style=";font-family:Thorndale AMT,serif;font-size:130%;" ><b>Character/Line measurement unit and ruler (</b></span><span style="font-size:130%;"><a title="i72655" href="http://qa.openoffice.org/issues/show_bug.cgi?id=72655" id="d5p."><b>i72655</b></a> </span><span style=";font-family:Thorndale AMT,serif;font-size:100%;" ><span style="font-size:130%;"><b>)</b></span><br /></span></p><p style="margin-bottom: 0cm;"> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >Character/line measurement unit and ruler is another important CJK function that OOo doesn't support now.</span> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >As shown in Figure 7 from MS Word 2003, character is used to measured the indentation of the paragraph, and the line is used to measure the paragraph spacing.</span> </p><div id="val8" style="padding: 1em 0pt; text-align: center;"><img style="width: 344px; height: 474px;" src="http://docs.google.com/File?id=dhk62h9x_77f2tt4hc8" /><br /><b>Figure 7. Character/line measurement unit</b><br /></div> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >Also as shown in Figure 8 from MS Word 2003, the horizontal ruler can be measured by character, and the vertical ruler can be measure by line. Character/line ruler is always used in a document with text grid.<br /></span> </p> <p style="margin-bottom: 0cm;"> </p><div id="xghp" style="padding: 1em 0pt;"><img style="width: 100%;" src="http://docs.google.com/File?id=dhk62h9x_78hrsnv2g6" /><br /><div style="text-align: center;"><b>Figure 8. Character/line ruler</b><br /></div></div><p style="margin-bottom: 0cm;"> </p> <p style="margin-bottom: 0cm;"> </p><p><span style=";font-family:Thorndale AMT,serif;font-size:130%;" ><b>Paragraph style default settings for CJK (</b></span><span style="font-size:130%;"><a title="i54320" href="http://www.openoffice.org/issues/show_bug.cgi?id=54320" id="o6ta"><b>i54320</b></a> </span><span style=";font-family:Thorndale AMT,serif;font-size:130%;" ><b>)</b><br /></span></p><p style="margin-bottom: 0cm;"> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >Currently, the paragraph style default settings are set for western users, some default values of the paragraph properties don't need the habit of CJK users.</span> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >For example, the default font size of western font size is 12pt, while it is 10.5pt for CJK. The current default tab spacing is 1.25cm, while it is too big in writing Chinese. It is better to use about 0.74cm in writing Chinese.</span> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >As shown in Figure 9, the current default setting of Asian typography is not suitable for CJK users yet.</span></p><div id="mgf1" style="padding: 1em 0pt; text-align: center;"><img style="width: 521px; height: 310px;" src="http://docs.google.com/File?id=dhk62h9x_79gcvz6mcv" /><br /><b>Figure 9. Asian typography</b><br /></div> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >Another example is the default value of automatic text indent. The automatic text indent is used to specify the leave spacing for the first line of a paragraph. The current default value is one-character while it is better to use two-characters in writing Chinese as shown in Figure.</span> </p> <p style="margin-bottom: 0cm;"> </p><p><span style=";font-family:Thorndale AMT,serif;font-size:130%;" ><b>Punctuation compress </b><br /></span></p><p style="margin-bottom: 0cm;"> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >As shown in Figure 10 , if two Chinese punctuation are close, the first one should be compressed to occupy only half spacing of a Character, not full spacing of a character.</span> </p><div id="qjc7" style="padding: 1em 0pt; text-align: center;"><img style="width: 690px; height: 241px;" src="http://docs.google.com/File?id=dhk62h9x_80c2hftgv9" /><br /><b>Figure 10. punctuation compress</b><br /></div> <p style="margin-bottom: 0cm;"> </p><p><span style=";font-family:Thorndale AMT,serif;font-size:130%;" ><b>Butters and numberings (</b></span><span style="font-size:130%;"><a title="i70031" href="http://www.openoffice.org/issues/show_bug.cgi?id=70031" id="gf55"><b>i70031</b></a><b> , </b><a title="i69855" href="http://www.openoffice.org/issues/show_bug.cgi?id=69855" id="q0un"><b>i69855</b></a> </span><span style=";font-family:Thorndale AMT,serif;font-size:130%;" ><b>)</b><br /></span></p><p style="margin-bottom: 0cm;"> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >I have heard many CJK users to complaint that the bullets and numbering are not so good.</span> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >For example, OOo can only automatic recognize Arabic numbers or alphabets. Most CJK numbers can not be automatic recognized.</span> </p> <p style="margin-bottom: 0cm;"> <span style=";font-family:Thorndale AMT,serif;font-size:100%;" >In the end, some important CJK functions are listed in the following wiki. <a href="http://wiki.services.openoffice.org/wiki/CJK_Group">http://wiki.services.openoffice.org/wiki/CJK_Group</a><br />If you have any good idea or suggestion about CJK functions, you are welcome to discuss in the wiki.</span> </p>Fong Linhttp://www.blogger.com/profile/03182572595236719782noreply@blogger.com4tag:blogger.com,1999:blog-5147096977216088439.post-42239752985903627832007-06-29T17:26:00.000+08:002008-12-12T13:58:18.727+08:00UOF Import Filter for OpenOffice.OrgThe UOF - Uniform Office Format is an emerging standard, which is being developed by the Chinese Office Software Work Group (COSWG), led by the China Electronics Standard Institute (CESI), the Ministry of Information Industry (MII), major suppliers of Chinese office software suites, and other academic institutions.<br /><br />This week is a hackfest week at Novell. I am hacking a UOF( Chinese Office File Format) import filter for OpenOffice.org. This filter is an external component based on <a href="http://odf-to-uof.sourceforge.net/" title="ODF-UOF Converter">ODF-UOF Converter.</a><br /><br />An extension is developed so that OpenOffice.Org is able to open UOF text document. Here is some screenshots.<br /><br /><img src="http://docs.google.com/File?id=dhk62h9x_37c5cpvwpx" /><br /><br /><div style="padding: 1em 0pt; text-align: left;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5MVGOmS_A5_QyYfSJcfX3tybG7PorWdnLv066S4aCDzXx7ZCt03fD-QbujazMC7-fGnRZAd9wbPl-NE3FKt68lC1WfDU3nNEeKN0DlWYR0S-PPbNFulXR8nsYUChtPjvDjfUy8HoTb6Fi/s1600-h/uof.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5MVGOmS_A5_QyYfSJcfX3tybG7PorWdnLv066S4aCDzXx7ZCt03fD-QbujazMC7-fGnRZAd9wbPl-NE3FKt68lC1WfDU3nNEeKN0DlWYR0S-PPbNFulXR8nsYUChtPjvDjfUy8HoTb6Fi/s400/uof.jpg" alt="" id="BLOGGER_PHOTO_ID_5081422527022875874" border="0" /></a><br /><br /></div><br />Although some features such as paragraph style, table are supported yet, there are a lot of work need to do. I will continue to work on them when I get time.Fong Linhttp://www.blogger.com/profile/03182572595236719782noreply@blogger.com0tag:blogger.com,1999:blog-5147096977216088439.post-149857510691321552007-05-28T10:33:00.000+08:002007-05-29T15:16:48.248+08:00UOF–OpenXML Translator<span style="font-size:100%;">I was surprised the news that Microsoft announced UOF-OpenXML translator project with China. The goal of UOF–OpenXML translator :<br /><br /><span style="font-style: italic;">"As part of Microsoft’s continued commitment to interoperability, Microsoft decided to work with CHINA Electronics Standardization Institute, Beijing Information Technology Institute, one of the co-creators of the UOF Chinese standard , Beihang University of Beijing and with other partners to create a Translator between UOF and Open XML and provide interoperability between the two formats in both directions. Microsoft is funding and providing technical architectural guidance for the development of the translator that will benefit millions of people who live in China."<br /><br /></span></span><div style="text-align: left;"><span style="font-size:100%;">In one sense, China is so important for Microsoft's further strategies.<br /></span><span style="font-size:100%;">It is time to do something about UOF plug-in for OpenOffice.org, isn't it?<br /><br />The UOF-OpenXML project is available at <a href="http://uof-translator.sourceforge.net/">http://uof-translator.sourceforge.net</a></span><span style="font-size:100%;">.<br /></span><span style="font-size:100%;">The UOF-ODF project is available at</span> <a href="http://odf-to-uof.sourceforge.net">http://odf-to-uof.sourceforge.net.</a><br /></div><br /><span style="font-size:85%;"><br /></span>Fong Linhttp://www.blogger.com/profile/03182572595236719782noreply@blogger.com0tag:blogger.com,1999:blog-5147096977216088439.post-46245667940015135502007-04-24T15:42:00.000+08:002007-04-24T18:08:19.058+08:00Issues wrt. text grid in IssuezillaThe prototype of text grid enhancement is available and the patch is under review now. Anybody who is interested in it could check out the patch from the cws cjksp1.<br /><br />Today, I happen to find that there are quite many text grid issues open in Issuezilla. I will look at them one by one and try to fix them. :)<br /><br />Some issues wrt. text grid in issuezilla:<br /><br /><a href="http://www.openoffice.org/issues/show_bug.cgi?id=53425">i53425</a>:more flexibility in the grid layout<br /><a href="http://www.openoffice.org/issues/show_bug.cgi?id=73011">i73011</a>:Chinese layout incorrectly with text grid<br /><a href="http://www.openoffice.org/issues/show_bug.cgi?id=40768">i40768</a>:CJK:Register-true not activated for frames when importing; Grid layout<br /><a href="http://www.openoffice.org/issues/show_bug.cgi?id=53464">i53464</a>:Word table reformatted shorter on import due to Grid layout<br /><a href="http://www.openoffice.org/issues/show_bug.cgi?id=15251">i15251</a>:"Snap to Grid" doesn't work correctly<br /><a href="http://www.openoffice.org/issues/show_bug.cgi?id=29543">i29543</a>:WW8: paragraph with "snap to grid" invisible in table<br /><a href="http://www.openoffice.org/issues/show_bug.cgi?id=15424">i15424</a>:baseline in grid<br /><a href="http://www.openoffice.org/issues/show_bug.cgi?id=55461">i55461</a>:snap to grid doesn't work correctly inside frame<br /><a href="http://www.openoffice.org/issues/show_bug.cgi?id=54864">i54864</a>:WW8: Different treatment of tables in page due to active CJK Grid<br /><a href="http://www.openoffice.org/issues/show_bug.cgi?id=72657">i72657</a>:A single line on Word got converted to two lines on Writer due to Text Grid<br /><a href="http://www.openoffice.org/issues/show_bug.cgi?id=68204">i68204</a>:option "Print grid" becomes inactive when reopening Page dialog<br /><a href="http://www.openoffice.org/issues/show_bug.cgi?id=35684">i35684</a>:[Text Grid] Vertical alignment for different font sizes differ from MS Word<br /><a href="http://www.openoffice.org/issues/show_bug.cgi?id=49214">i49214</a>:CJK: Line spacing interpretation is different between Word and Writer due to text grid<br /><a href="http://www.openoffice.org/issues/show_bug.cgi?id=24195">i24195</a>:WW Import: Cell height is too big when opened in OOo 1.1.1a (due to CJK-Grid)<br /><a href="http://www.openoffice.org/issues/show_bug.cgi?id=56820">i56820</a>:Ruby in vertical text in grid wrongly moves original text sideways<br /><br />Please let me know if anybody has question about text grid layout. :)Fong Linhttp://www.blogger.com/profile/03182572595236719782noreply@blogger.com0tag:blogger.com,1999:blog-5147096977216088439.post-58260075140707472412007-03-22T10:15:00.000+08:002007-03-22T11:57:27.005+08:00User scenarios of text gridThe following user scenarios of text grid are under investigation.<br /><br />1. When user creates a text document, the default paper mode of text grid is read from user preference settings. User can switch the default paper mode of text grid in text document options tab page. (Tools --> Options --> Text Document --> General) by clicking the check box "Use squared paper mode for text grid".<br /><br />2. When import a Ms Word 97/2000 file (.doc), the default paper mode is treated as "standard paper mode". <br /><br />3. When import a text document of the previous version of OO.org (.odt, .sxw), the default paper mode is treated as "squared paper mode"<br /><br />4. When user is editing a text document with text grid. <br />if he switchs the paper mode from "squared" to "standard", the following behavior is used:<br /> * line height = Max base text size + Max ruby text size<br /> * lines per page = type area height / line height<br /> * Max ruby text size = 0<br /><br />if he switch the paper mode from "standard" to "squared", the following behavior is used:<br /> * line height = type area height / lines per page<br /> * Max base text size = line height * 2 / 3<br /> * Max ruby text size = line height / 3Fong Linhttp://www.blogger.com/profile/03182572595236719782noreply@blogger.com0tag:blogger.com,1999:blog-5147096977216088439.post-90606961325150053042007-03-20T10:26:00.000+08:002008-12-12T13:58:19.271+08:00Two kinds of text grid layoutAs mensioned before, there are two kinds of text grid layout which are used in CJK users. One is "squared page mode", the other is "standard (rectangle) page mode".<br /><br />Per the text grid prososal approved by ODF TC, the style:layout-grid-standard-mode property is added to specified which kind of text grid is used for the document. <br /><br />In order to ensure that either “sqaured mode” or “standard mode “is used for the whole document, the style:layout-grid-standard-mode property can only be set for the default style of the “page-layout”. When the style:layout-grid-standard-mode attribute appears inside a style:page-layout definition, then the attribute MUST be ignored.<br /><br />Global setting entry for selection of which kind of text grid layout is used for the whole document. (Tools-->Options-->OpenOffice.Org Writer-->General)<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhw45lM49h48ITrrxI-p5twzOkRbfgLHWaRbdRni01XAj5UDHppl6phM5qN6rOc9ZkhPTmhznIVsODoaRT-qmRxMZsxqnODLrmLhbmDjeiWoQcSsb6sBn4XYdOOnLpY-vOzP5wXkyyY9NYv/s1600-h/squared2.png"><img style="cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhw45lM49h48ITrrxI-p5twzOkRbfgLHWaRbdRni01XAj5UDHppl6phM5qN6rOc9ZkhPTmhznIVsODoaRT-qmRxMZsxqnODLrmLhbmDjeiWoQcSsb6sBn4XYdOOnLpY-vOzP5wXkyyY9NYv/s400/squared2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5043835495494679970" /></a><br /><br />When the "Use squared page mode for text grid" is checked, the original tab page of text grid is used.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnKhrpPha3KkxaAJm5h31f4om_X3jB2kwH3cmyaR9pmR9Gl-BTSbwMxUcZvAsJynufiCiWzk9FDEaNCpUVSRIlytDYBLMkJGQR0I7e_HozoNxuuzaWEzY4w7EMi8oLefjtadQ2bFic-Hr5/s1600-h/squared.png"><img style="cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnKhrpPha3KkxaAJm5h31f4om_X3jB2kwH3cmyaR9pmR9Gl-BTSbwMxUcZvAsJynufiCiWzk9FDEaNCpUVSRIlytDYBLMkJGQR0I7e_HozoNxuuzaWEzY4w7EMi8oLefjtadQ2bFic-Hr5/s400/squared.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5043834468997496194" /></a><br /><br />When the "Use squared page mode for text grid" is unchecked, the following tab page of text grid is used.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaCOg0T2o2d_tGpVOEDN1GcdyFRWvPpul-2KTvmKpaTDBQ78rA2oNih6Nf9SOAagCH7BuG3neWkN3t0vw01iLzrNz_eGQacTtiUeOkcLNQM4moXl7Z7CabGxiKSH8YdB5Mtnrqk8sqmIOi/s1600-h/standard.png"><img style="cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaCOg0T2o2d_tGpVOEDN1GcdyFRWvPpul-2KTvmKpaTDBQ78rA2oNih6Nf9SOAagCH7BuG3neWkN3t0vw01iLzrNz_eGQacTtiUeOkcLNQM4moXl7Z7CabGxiKSH8YdB5Mtnrqk8sqmIOi/s400/standard.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5043834679450893714" /></a>Fong Linhttp://www.blogger.com/profile/03182572595236719782noreply@blogger.com0tag:blogger.com,1999:blog-5147096977216088439.post-2113170082971026352007-03-13T11:59:00.001+08:002007-03-13T14:28:19.812+08:00Text grid in Ms Word 97 binary file format<p style="margin-bottom: 0cm;"><span style="font-family:Thorndale AMT,serif;">In Ms Word 97 binary file format, there are three SPRMs to deal with grid. They are:</span></p> <table style="color: rgb(0, 0, 0); width: 552px; height: 118px;" border="1" cellpadding="6" cellspacing="0"> <col width="99"> <col width="37"> <col width="88"> <col width="28"> <col width="171"> <tbody><tr valign="top"> <td width="99"> <p><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">Name</span></span></p> </td> <td width="37"> <p><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">sprm</span></span></p> </td> <td width="88"> <p><span style="font-family:Thorndale AMT,serif;"><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">Property</span></span></span></p> </td> <td width="28"> <p><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">size</span></span></p> </td> <td width="171"> <p><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">Description</span></span></p> </td> </tr> <tr valign="top"> <td width="99"> <p><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">sprmSDxtCharSpace</span></span></p> </td> <td width="37"> <p><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">0x7030</span></span></p> </td> <td width="88"> <p><span style="font-family:Thorndale AMT,serif;"><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">Sep.dxtCharSpace</span></span></span></p> </td> <td width="28"> <p><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">long</span></span></p> </td> <td width="171"> <p><span style="font-family:Thorndale AMT,serif;"><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">Specifies the grid width</span></span></span></p> </td> </tr> <tr valign="top"> <td width="99"> <p><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">sprmSDyaLinePitch</span></span></p> </td> <td width="37"> <p><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">0x9031</span></span></p> </td> <td width="88"> <p><span style="font-family:Thorndale AMT,serif;"><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">Sep.dyaLinePitch</span></span></span></p> </td> <td width="28"> <p><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">long</span></span></p> </td> <td width="171"> <p><span style="font-family:Thorndale AMT,serif;"><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">Specifies the grid height</span></span></span></p> </td> </tr> <tr valign="top"> <td width="99"> <p><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">sprmSClm</span></span></p> </td> <td width="37"> <p><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">0x5032</span></span></p> </td> <td width="88"> <p><span style="font-family:Thorndale AMT,serif;"><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">Sep.clm</span></span></span></p> </td> <td width="28"> <p><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">long</span></span></p> </td> <td width="171"> <p><span style="font-family:Thorndale AMT,serif;"><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">Specifies the grid type</span></span></span></p> </td> </tr> </tbody></table> <p style="margin-bottom: 0cm;"><br /></p> <p style="margin-bottom: 0cm;"><span style="font-family:Thorndale AMT,serif;">sprmSClm has four values, which corresponds to four types of grid.</span></p> <table style="color: rgb(0, 0, 0);" border="1" cellpadding="6" cellspacing="0" width="301"> <col width="59"> <col width="40"> <col width="164"> <tbody><tr valign="top"> <td width="59"> <p><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">Name</span></span></p> </td> <td width="40"> <p><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">value</span></span></p> </td> <td width="164"> <p><span style="font-family:Thorndale AMT,serif;"><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">Grid type</span></span></span></p> </td> </tr> <tr valign="top"> <td rowspan="4" width="59"> <p><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">sprmSClm</span></span></p> </td> <td width="40"> <p><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">0</span></span></p> </td> <td width="164"> <p><span style="font-family:Thorndale AMT,serif;"><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">No grid</span></span></span></p> </td> </tr> <tr valign="top"> <td width="40"> <p><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">1</span></span></p> </td> <td width="164"> <p><span style="font-family:Thorndale AMT,serif;"><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">Specify line and character grid</span></span></span></p> </td> </tr> <tr valign="top"> <td width="40"> <p><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">2</span></span></p> </td> <td width="164"> <p><span style="font-family:Thorndale AMT,serif;"><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">Specify line grid only</span></span></span></p> </td> </tr> <tr valign="top"> <td width="40"> <p><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">3</span></span></p> </td> <td width="164"> <p><span style="font-family:Thorndale AMT,serif;"><span style="font-family:Times New Roman,serif;"><span style="font-size:85%;">Text snaps to character grid</span></span></span></p> </td> </tr> </tbody></table> <p style="margin-bottom: 0cm;"><br /></p>Fong Linhttp://www.blogger.com/profile/03182572595236719782noreply@blogger.com2tag:blogger.com,1999:blog-5147096977216088439.post-4118516536079688722007-03-12T19:11:00.001+08:002008-12-12T13:58:19.793+08:00Text grid enhancement in MS Office 2007<p style="margin-bottom: 0cm;"><span style="font-family:Thorndale AMT,serif;">Today, I downloaded and installed a Chinese trial version of MS Office 2007. I was surprised that “Square page mode” is also supported in MS word 2007, which is not supported in previous version.</span></p> <p style="margin-bottom: 0cm;"><span style="font-family:Thorndale AMT,serif;">Below illustrates the menu entry for “square mode” setting. ( Maybe this function is disabled in none_CJK version in default)</span><span style="font-family:Thorndale AMT,serif;">.</span> </p> <p style="margin-bottom: 0cm;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivW4h67h9-NRXoPHY7CdO5_lo9DopbXurl74zjqyB1XXm-bgyD8_782teqjAy0u6tVIfDZQJ6MVR6Lv-egekuPVunHplmagM39SB1QMDvl3_ru7wfLQaJcLbFafpbwYwIhF0s3xI069tH9/s1600-h/squaredpage_html_6938b944.png"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivW4h67h9-NRXoPHY7CdO5_lo9DopbXurl74zjqyB1XXm-bgyD8_782teqjAy0u6tVIfDZQJ6MVR6Lv-egekuPVunHplmagM39SB1QMDvl3_ru7wfLQaJcLbFafpbwYwIhF0s3xI069tH9/s400/squaredpage_html_6938b944.png" alt="" id="BLOGGER_PHOTO_ID_5041980623939770626" border="0" /></a></p> <p style="margin-bottom: 0cm;"><span style="font-family:Thorndale AMT,serif;">Setting tab page:</span></p><p style="margin-bottom: 0cm;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfIn0vnfTG8oeHstmBeRApSu9qa6deGv4UmuRSNYuiiTMmJvN7qZ9C3024juaq9lcCMA31cF-W2_vK-x9XuyekCmjhTt8KHm-vk_i8AkUL6Aq9Fch3_1b9zWNflno2LDdoUgYnxj5SJdsV/s1600-h/squaredpage_html_m58bef846.png"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfIn0vnfTG8oeHstmBeRApSu9qa6deGv4UmuRSNYuiiTMmJvN7qZ9C3024juaq9lcCMA31cF-W2_vK-x9XuyekCmjhTt8KHm-vk_i8AkUL6Aq9Fch3_1b9zWNflno2LDdoUgYnxj5SJdsV/s400/squaredpage_html_m58bef846.png" alt="" id="BLOGGER_PHOTO_ID_5041980731313953042" border="0" /></a></p> <p style="margin: 0.48cm 0.69cm; line-height: 0.68cm; widows: 2; orphans: 2;" align="center" lang=""> </p> <p style="margin-bottom: 0cm;"><span style="font-family:Thorndale AMT,serif;">Squared page (20 <span style="font-family:宋体,SimSun;">×</span>20):</span></p><p style="margin-bottom: 0cm;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZ4cXvAj1O0ddXQJLfd0a6bZFlefvAOq9L12BHnxASG6ZsxT4IkBj6auZArYZ-RL7OEQOW-Z2CATM2fc2-QgcFtYc3dlQNgRY9kCJxqredZ0_uyI3bfLLm_AtGVgSA_xH-XONGDp1JULNM/s1600-h/squaredpage_html_m94af3d3.png"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZ4cXvAj1O0ddXQJLfd0a6bZFlefvAOq9L12BHnxASG6ZsxT4IkBj6auZArYZ-RL7OEQOW-Z2CATM2fc2-QgcFtYc3dlQNgRY9kCJxqredZ0_uyI3bfLLm_AtGVgSA_xH-XONGDp1JULNM/s400/squaredpage_html_m94af3d3.png" alt="" id="BLOGGER_PHOTO_ID_5041980920292514082" border="0" /></a> </p> <p style="margin-bottom: 0cm;"><span style="font-family:Thorndale AMT,serif;">If the “square page mode” is enabled, the page setting menu is disabled. “standard page mode” setting is not allowed, which avoids mixed page mode in a document.</span></p>Fong Linhttp://www.blogger.com/profile/03182572595236719782noreply@blogger.com1tag:blogger.com,1999:blog-5147096977216088439.post-46685034551560149342007-02-26T15:33:00.000+08:002008-12-12T13:58:19.956+08:00Text doesn't snap to gridContiue to investigate the layout behavior when the text doesn't snap to grid.<br /><br />For East Asian text, not more than one Asian character is displayed within a signle cell. The space between two Asian characters is (grid width - font height)<br /><br />For Western text, The space between two Western characters is (grid width - font height)/2.<br /><br />The following diagram illustrates this algorithm in brief.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmy29zFQLxfD4p9BwcQXP9ifJ3wglqWxiUFRH138h07K1jR_94p4ZWEr1bvhzeqqyogSY3RjNDqe9M2fgIuQ37BF09Qm9SX_FkBlrFiy9rzRx2dP2JbMr6STvWSFSchr5Ep0o8DNAxtPiE/s1600-h/oo2_no_snap1.png"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmy29zFQLxfD4p9BwcQXP9ifJ3wglqWxiUFRH138h07K1jR_94p4ZWEr1bvhzeqqyogSY3RjNDqe9M2fgIuQ37BF09Qm9SX_FkBlrFiy9rzRx2dP2JbMr6STvWSFSchr5Ep0o8DNAxtPiE/s400/oo2_no_snap1.png" alt="" id="BLOGGER_PHOTO_ID_5035777039785954450" border="0" /></a><br /><br />Certainly, it just specifies what happens if grid width is greater than font height.Fong Linhttp://www.blogger.com/profile/03182572595236719782noreply@blogger.com1tag:blogger.com,1999:blog-5147096977216088439.post-91397886678868753222007-02-16T14:57:00.000+08:002007-02-16T15:41:08.963+08:00Some knowledge about text gridI just checked the Office OpenXML file format and try to find the difference between the two types of text grid.<br /><ul><li> <span style="font-weight: bold;">linesAndChars (Line and Character Grid):</span> Specifies that the parent section shall have both the additional line pitch and character pitch added to each line and character within it (as specified on the docGrid element (§2.6.5)) in order to maintain a specific number of lines per page and characters per line. When this value is set, the input specified via the user interface may be allowed in exact number of line/character pitch units.</li><li><span style="font-weight: bold;">snapToChars (Character Grid Only) : </span>Specifies that the parent section shall have both the additional line pitch and character pitch added to each line and character within it (as specified on the docGrid element (§2.6.5)) in order to maintain a specific number of lines per page and characters per line.When this value is set, the input specified via the user interface may be restricted to the number of lines per page and characters per line, with the consumer or producer translating this information based on the current font data to get the resulting line and character pitch values </li></ul>OpenXML file format just specifies the difference of the user interface between these two types of text grid, while it doesn't piont out the difference of the layout behavior, especially for the layout behavior of Asian text and Webtern Text.<br /><br />It seems that the author of the specification doen't know the essential difference between these two types of text grid. :-)<span class="" style="display: block;" id="formatbar_CreateLink" title="链接" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 8);ButtonMouseDown(this);"></span><br />Currently, I am investigating the Document Grid specified in CSS3 mensioned by Florian.<br /><a href="http://www.w3.org/TR/2003/CR-css3-text-20030514/#document-grid">http://www.w3.org/TR/2003/CR-css3-text-20030514/#document-grid</a>Fong Linhttp://www.blogger.com/profile/03182572595236719782noreply@blogger.com0tag:blogger.com,1999:blog-5147096977216088439.post-28358930865640782962007-02-15T16:33:00.000+08:002008-12-12T13:58:20.873+08:00Investigated the behavior of "Text snaps to characters grid".<br />* If the grid type is grid(line and characters) and the "snap-to-characters" attribute is ture, the Asian character is centered in the single cell, while the non Asian text is centered within as many cells as required.<br /><br />* If the grid type is grid(line and characters) and the "snap-to-characters" attribute is false, the Asian character is not centered in the single cell, but what is the behavior for the non Asian text?<br /><br />Below is the screenshot from MS Word<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia8APX1g-NiTCrO91dFR5iy8nfVEdIRJzSC4YOf_vq3gnJFK7B2d-ezARRTA1ZZwRyX3uWAaBkqDKsUlIjiFeUqybvAS8a6L3F1QvpIClz_a7kmJGJ3osypbXGduLHuAoPnsrkK7At6YOX/s1600-h/word_snap_chars1.bmp"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia8APX1g-NiTCrO91dFR5iy8nfVEdIRJzSC4YOf_vq3gnJFK7B2d-ezARRTA1ZZwRyX3uWAaBkqDKsUlIjiFeUqybvAS8a6L3F1QvpIClz_a7kmJGJ3osypbXGduLHuAoPnsrkK7At6YOX/s400/word_snap_chars1.bmp" alt="" id="BLOGGER_PHOTO_ID_5031679849227472450" border="0" /></a><br />Figure 1,<span lang="en-US">Text snaps to character grid </span><span style="text-decoration: underline;"><br /></span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS8Uhf3bfzYX2x1UZGO5YWduddjpIfAwK7lFu0KsTEJQqtVR0PSm4gu4KE40ZM3-SO2XV2CYy6a4IPkcauAYQK2cMeUDYwZ7Ui0jIpdwImO8vVgIz5EemP3tbv-y6kCOkzW0_AQNou27T2/s1600-h/word_snap_chars_no2.bmp"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS8Uhf3bfzYX2x1UZGO5YWduddjpIfAwK7lFu0KsTEJQqtVR0PSm4gu4KE40ZM3-SO2XV2CYy6a4IPkcauAYQK2cMeUDYwZ7Ui0jIpdwImO8vVgIz5EemP3tbv-y6kCOkzW0_AQNou27T2/s400/word_snap_chars_no2.bmp" alt="" id="BLOGGER_PHOTO_ID_5031681266566680210" border="0" /></a><br />Figure 2, <span lang="en-US">Specify line and character grid<br /><br />It seems that there is a special behavior for non Asian text when the text doesn't snap to the character grid.<br />Where can I get some clues?<br /></span>Fong Linhttp://www.blogger.com/profile/03182572595236719782noreply@blogger.com0tag:blogger.com,1999:blog-5147096977216088439.post-7743966933160971192007-02-14T19:54:00.000+08:002008-12-12T13:58:21.981+08:00Text Grid EnhancementIt is my pleasure to announce a new enhancement feature (Text Grid) in writer document. Currently I am work on this feature.<br /><br />* <span style="font-weight: bold;">C</span><span style="font-weight: bold;">reate a new page in openoffice wiki to ask for input</span>. Here is the link : <a href="http://wiki.services.openoffice.org/wiki/Text_grid">http://wiki.services.openoffice.org/wiki/Text_grid</a><br /><br />* <span style="font-weight: bold;">Below is the two kinds of text grid layout.</span><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3o46RIhcQ4VgLX4RqQtO1RMvEremUui-ROkpFhss4oqYzQEhSVqE_cLiTdomv9LabE_N7zTh0QIrIFn4sEp7vMr_ad6EeWWYw2RPbMsyda6rAdCQKUWQQeYuToFaLZGhdT_yt8lmeldOk/s1600-h/square1.jpg"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3o46RIhcQ4VgLX4RqQtO1RMvEremUui-ROkpFhss4oqYzQEhSVqE_cLiTdomv9LabE_N7zTh0QIrIFn4sEp7vMr_ad6EeWWYw2RPbMsyda6rAdCQKUWQQeYuToFaLZGhdT_yt8lmeldOk/s400/square1.jpg" alt="" id="BLOGGER_PHOTO_ID_5031367961587338690" border="0" /></a><br /><br /><br /><br /><br /><br /><br />Figure1, Squared page mode<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_f3_WNYO0u7AhJ9_etk6N2ZQh2udB60QBCT3v91_WMOXB-hb0hpGuXlrcU9qT9BbNhi2Jm5wV_81gOJItrbDZMInDeCnmag3ZFo-svvLmTdCTH689mRQcWyv4MB9uBypb1Kt5xPXUZE7z/s1600-h/rectangle2.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_f3_WNYO0u7AhJ9_etk6N2ZQh2udB60QBCT3v91_WMOXB-hb0hpGuXlrcU9qT9BbNhi2Jm5wV_81gOJItrbDZMInDeCnmag3ZFo-svvLmTdCTH689mRQcWyv4MB9uBypb1Kt5xPXUZE7z/s400/rectangle2.jpg" alt="" id="BLOGGER_PHOTO_ID_5031368253645114834" border="0" /></a><br />Figure2, Rectangle page mode<br /><br />1) "Squared paper mode". It is used by ODF.<br />For this kind of grid layout, the page is divided in a fixed numbers of lines (lines per page). The lines are divided into squared cells (characters per line). The number of lines per page depends on the line height ( i.e., the sum of grid base and ruby height), and the characters per line also depends on the line height.<br /><br />In "Squared paper mode", the “Characters per line” setting has the most high priority, it will determine the height of line, then the “Lines per page” setting has the second priority, it will determine the height of type area.<br /><br />This kind of grid layout "Squared paper mode" is used to simulate “squared paper”, which is a kind of specific paper used 20 years ago(before personal computer is widely used in text processing). But now, “squared paper” is only used in very limited case, and most CJK users won't use it anymore.<br /><br />2) "Rectangle paper mode". It is used by OpenXML, UOF (Chinese Office File Format) and other CJK office suites (i.e., EIOFFICE, WPS).<br />For this kind of grid layout, the page is divided in a fixed numbers of lines (lines per page). While the lines are divided into rectangle cells (characters per line). Ruby grid is not specified in this paper mode. So the line height is grid base height and the characters per line depends on the grid base width, not grid base height.<br /><br />In "Rectangle paper mode", type area has the most high priority, it will determine the height of line; the “Lines per page” setting has the second priority, and “Characters per line” setting can only determine the width of characters, and can't influence line height in anyway.<br /><br />This kind of grid layout "Rectangle paper mode" is wildly used in CJK users.<br /><br /><span style="font-weight: bold;">* Snap to characters<br /></span><p><span style="font-family:Thorndale AMT,serif;"><span style="font-size:100%;"><span lang="en-US">We add a “snap to characters” attributes to specify whether the Asian character is centered in the grid cell or not when the grid type is set as “Grid(lines and characters)”. The default value “snap to characters” is “true”.</span></span></span></p> <p><span style="font-family:Thorndale AMT,serif;"><span style="font-size:100%;"><span lang="en-US">This additional attribute also improve the compatibility with MS word. Below is the map of grid type between MS Word 2003 and OpenOffice</span></span></span></p> <table style="color: rgb(0, 0, 0);" border="1" cellpadding="4" cellspacing="0" width="100%"> <col width="128*"> <col width="128*"> <tbody><tr valign="top"> <td width="50%"> <pre><span lang="en-US"><b>Word 2003</b></span></pre> </td> <td width="50%"> <pre><span lang="en-US"><b>OpenOffice.org 2.1.0</b></span></pre> </td> </tr> <tr valign="top"> <td width="50%"> <pre><span lang="en-US">1. No grid</span></pre> </td> <td width="50%"> <pre><span lang="en-US">A. No grid</span></pre> </td> </tr> <tr valign="top"> <td width="50%"> <pre><span lang="en-US">2. Specify line grid only (Default)</span></pre> </td> <td width="50%"> <pre><span lang="en-US">B. Grid (lines only) (Default)</span></pre> </td> </tr> <tr valign="top"> <td width="50%"> <pre><span lang="en-US">3. Specify line and character grid </span></pre> </td> <td width="50%"> <pre><a name="DDE_LINK3"></a><span lang="en-US">C. Grid (lines and characters), “snap-to-characters” is false.</span></pre> </td> </tr> <tr valign="top"> <td width="50%"> <pre><span lang="en-US">4. Text snaps to character grid </span></pre> </td> <td width="50%"> <pre><span lang="en-US">D. Grid (lines and characters), “snap-to-characters” is true.</span></pre> </td> </tr> </tbody></table><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipfGN_XV2ryRX3hGkb8v5vLVWc1bSDnrjAvqdFSeslJJ41vPg8OFu5J76yAp_MC9lC9RP6iEmxxy7kmxpNKZIaqYhsygYJnc46YTRPGhrZf1nJVRitptvb38Ns4QzbvcY0iYSNndfyptM6/s1600-h/nogrid.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipfGN_XV2ryRX3hGkb8v5vLVWc1bSDnrjAvqdFSeslJJ41vPg8OFu5J76yAp_MC9lC9RP6iEmxxy7kmxpNKZIaqYhsygYJnc46YTRPGhrZf1nJVRitptvb38Ns4QzbvcY0iYSNndfyptM6/s400/nogrid.jpg" alt="" id="BLOGGER_PHOTO_ID_5031376014651018722" border="0" /></a><br />Figure 3. <span><span lang="en-US">No grid<br /></span></span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4CrhHSpPUv-fb3k6dRk1Ki6Ix-08YF0AA6bzmByisOURe2zPG8KTvJT2Fe1UD1wd1URr_4Czcv1gWTSPP4EWZ4sse8NVoXVx3VY0l8vIMhAzhpoXHoHD8NiYT1r8WNKvIbiOH9sn5W4XU/s1600-h/linegrid.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4CrhHSpPUv-fb3k6dRk1Ki6Ix-08YF0AA6bzmByisOURe2zPG8KTvJT2Fe1UD1wd1URr_4Czcv1gWTSPP4EWZ4sse8NVoXVx3VY0l8vIMhAzhpoXHoHD8NiYT1r8WNKvIbiOH9sn5W4XU/s400/linegrid.jpg" alt="" id="BLOGGER_PHOTO_ID_5031376298118860274" border="0" /></a><br />Figure 4 . <span><span lang="en-US">Grid (lines only)<br /><br /></span></span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv-Cfa0oJbi4rxd83JdCTPyGW9RsckU63WQcftMMmkMb7erJZCTdLaw3lV8LFbAVDKK0XmY8qj8-J57Ie4CZujO3Q7JbBhJ4Aoto-hXI9EDz3wVBrfZGxqVNrYwMb8R0C06KgKQZnaudGn/s1600-h/no-snap-to-chars.gif"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv-Cfa0oJbi4rxd83JdCTPyGW9RsckU63WQcftMMmkMb7erJZCTdLaw3lV8LFbAVDKK0XmY8qj8-J57Ie4CZujO3Q7JbBhJ4Aoto-hXI9EDz3wVBrfZGxqVNrYwMb8R0C06KgKQZnaudGn/s400/no-snap-to-chars.gif" alt="" id="BLOGGER_PHOTO_ID_5031376693255851538" border="0" /></a><br />Figure 5. <span><span lang="en-US">Grid (lines and characters), “snap-to-characters” is false<br /></span></span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnEaVip0SFXYBMe9xAd-cFHsucsZVvFcn0T8rdQWnh-WIQUhOM1mZ4j-ewjmOL3DwOrkb3A9kCPrfrW32wEap93JvEWE_-GmOLb9b6B8MLFjF1L6KRcxYaeZ8YuJchTYm51LBFyaijk-Hv/s1600-h/snap-to-chars.gif"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnEaVip0SFXYBMe9xAd-cFHsucsZVvFcn0T8rdQWnh-WIQUhOM1mZ4j-ewjmOL3DwOrkb3A9kCPrfrW32wEap93JvEWE_-GmOLb9b6B8MLFjF1L6KRcxYaeZ8YuJchTYm51LBFyaijk-Hv/s400/snap-to-chars.gif" alt="" id="BLOGGER_PHOTO_ID_5031377672508395058" border="0" /></a><br /><br />Figure 6. <span><span lang="en-US">Grid (lines and characters), “snap-to-characters” is true<br /><br />As shown in Figure 5, when "snap-to-chars" is false, the Asian characters are not centered in the cell, while the Western character ("OpenOffice.Org) are also centered in the cell. This is not accurate. It is work in progress now.<br /></span></span>Fong Linhttp://www.blogger.com/profile/03182572595236719782noreply@blogger.com0tag:blogger.com,1999:blog-5147096977216088439.post-48390019592673936242007-02-14T19:34:00.000+08:002007-02-14T19:54:10.267+08:00Valentine's Day EveningIn Valentine's Day evening, other staffs are off work. Only I am in office to create a blog to blog what I am doing everyday, quite interesting.<br />Florian help me to create it, thank FlorianFong Linhttp://www.blogger.com/profile/03182572595236719782noreply@blogger.com0