« WPFの縦書き | Main | WPF Text API »

2007.11.27

WPFの縦書き続き

WPFの縦書きの続き。

Word の XPS 出力はきちんと縦書きになっていた。XPS には縦書き、というか、縦書き用にグリフを反時計回りに90度回転する、という IsSideways がある。これで文字を回転しておいて、行を逆に時計回りに90度回転すれば、縦書きになるでしょ、という仕様。

しかし日本語には、「、」や「ー」などのように縦書きになると位置や形が変わる文字がある。XPS の IsSideways はそれは解釈してくれない模様。アプリがやれ、という話らしい。FontVariants に Ruby があったり、EastAsianLanguage に異体字があったりするので、どちらかに入りそうなものだが、これがない。ルビ専用グリフをやる前に縦書き用グリフじゃないの、と思うが、ないものはない。

だから、XPS の仕様書で句読点の位置がおかしいのにはそれなりに理にかなっていて、XPS 1.0 ではそこまで自動では面倒見ませんよ、という話らしい。Glyphs には Unicode 文字列を指定するモードとグリフインデックスを指定するモードがあるので、Unicode 文字列じゃなくて縦書き用のグリフを指定してくれれば表示できます、というお話。Unicode 文字列で動いているアプリを縦書き対応するには、グリフインデックスを取れ、というお話。Word は元々自前でフォントを読み込んでグリフインデックスで指定しているから、縦書きできる。横書きは Unicode 文字列でも動くようになっているのになぁ。

で、フォント周りのクラスを覗くと、通常の文字コードからグリフインデックスへの変換はサポートされているのだが、縦書き用グリフインデックスが取れそうにない。ぎょぎょ。フォントファイルを直接読め、という話か。フォント周りのクラスは、FontFamily と Typeface が主だったクラスのようだが、他に FamilyTypeface, GlyphTypeface というのがある。この辺の関連はいまいち不明。でもどこにも見当たらない。

フォントまわりを一旦あきらめて少し上のレベルを探ると、WPF の組版関連は結構なボリュームがあり、またレイヤーに分かれている。レイヤー毎に同じようなクラス名があるのでややこしい。

  • TextBox は TextFormatter を利用して組版を行う。
  • RichTextBox は FlowDocument を利用して組版を行う。FlowDocument はその下で TextFormatter を利用している模様。

最終的にどちらも TextFormatter に落ち着くらしい。これが TextRun とか TextSpan とかの組み合わせで組版結果を表現するようだ。ここから TextLine.Draw で DrawingContext へ。だから縦書きの出力をしたいなら、まず TextFormatter に手を入れることになりそうだが、この辺は abstract と internal 実装でしっかりガード。でも中で TextBox と RichTextBox は実装が分かれていて、RichTextBox は LineServices/PTS を使っているらしい。だったらその中は縦書きをサポートしていそうなものだが、上と下に繋がっていない、ということらしい。

さて。とても困った、ということが分かった。縦書きだけやりたいなら WPF を諦めて GDI に戻る。でもやりたいのは OpenType を使った縦書き。GDI/GDI+ ベースの Windows Forms では OpenType を上手に扱えない。GDI/GDI+ ではプロの印刷品質も出せない。

Mac + PostScript/PDF を使えよ、というお話?

|

« WPFの縦書き | Main | WPF Text API »

Comments

Јust listening and paying attention to what your spouѕe says іndicates that you really care about whаt they are feeling. Put thoѕe meetings on your prіority list and make surе to set a time a side to spend with your partner, once the prіority list is dоne don't allow yourself to change it. Mеn are wired to be phyѕically attracted to a woman.

Posted by: respark the romance pdf | 2013.12.22 at 11:19 AM

However, by early next morning, in most cases you will notice that your weight has considerably dropped compared to where it was the previous night. If the your body fat is above 25% but below 30% (Women) or above 20% but below 25% ( Men) then you are overweight, you are carrying more fat around than you need or that is healthy for you and it probably means you are eating too much of the wrong foods. That is why you only need to follow the above guidelines 90% of the time, which allows for 4-5 cheat meals per week.

Posted by: il fattore brucia grasso pdf | 2014.01.01 at 09:06 PM

WҺat sɦe ѕaid is thiѕ: I was doiոg WOT for 15 ѕecoոds ɑnd recovery for 45 seconds. Even though exercises significаntly help іո helpіng individuals to lose love handles, it should be remembеred that even the Ƅest exercise is certainly not ǥoing to hеlp you to get riɗ of love handles unless you take control of your ѕaliνary ցlands from beginոing watеring as soon as you see fairly sweet, spicy, melted and crispy delicаcies. Insulin resistance reduces the amount of glucose that is absorbed and stored by the orցаns and muscle tissue.

Posted by: il fattore brucia grasso pdf | 2014.02.11 at 09:50 PM

Ԝhat she said is this: I was doing WOT for 15 seconds and recovery for 45 seconds. This іs easily eхplained by thе fact that this kind of food is simply loaded with fiber, ѵitamins and minerals. Insuliո resistance rеduces tɦe amoսnt of glucose that is absorbed and stored by the organs and muscle tissue.

Posted by: il fattore brucia grasso pdf | 2014.02.24 at 05:03 AM

めちゃイケだっけで、じゅりなと指原がキスしてたよ。 でもこうして、玲奈さんが乃木坂を兼任なさることで 在日企業電通、創価のお偉いさんの池田は帰化朝鮮人。

Posted by: tapzilla.com | 2014.08.15 at 04:12 PM

Everyone has an opinion whether it be right or wrong. Just remember that communication is key and that you need to hear him out, too. This can be rather straight forward lengthy distance relationship assistance.

Posted by: respark the romance review | 2014.12.28 at 07:52 AM

If you'd like some awesome accessories, they may also assist. These figures are staggering, and should make us all sit up and take a hard look at the way we live in the modern age. Google Panda and Penguin update made a huge impact the SEO world.

Posted by: penguin method review | 2015.01.12 at 03:53 AM

'Reminds one of the Seinfeld stand-up routine about the qualifications for a New York City cabbie's license: all one seems to need is a face. I don't care if you cheat and relive your nursery school years, as long as you read every bit of that Anne Rice pulp that you first discovered and devoured WHOLE back then. What alarms me is, these days, the 'structure' of a person's home or family has understandably changed to fit the current times, but in many ways, the change has been one of de-solidification and a lessening, or removal of boundaries.

Posted by: Hershel | 2015.02.16 at 05:45 AM

It's wonderful that you are getting thoughts from this paragraph as well as from our discussion made at this time.

Posted by: รถรับจ้าง | 2015.03.15 at 11:01 PM

Does your blog have a contact page? I'm having problems locating it but, I'd like to send you an email. I've got some creative ideas for your blog you might be interested in hearing. Either way, great blog and I look forward to seeing it improve over time.

Posted by: http://user.ifenghui.com | 2015.05.14 at 06:07 AM

I think the admin of this web page is actually working hard in favor of his web site, since here every data is quality based stuff.

Posted by: fastest search engine | 2015.06.15 at 12:35 PM

Install an application called iFile , this can only be done if you have a jail broken device.

Posted by: Boom Beach Hack No Password | 2015.07.06 at 05:34 PM

Excellent post. Keep writing such kind of information on your blog. Im really impressed by it. Hello there, You've performed an excellent job. I'll certainly digg it and for my part suggest to my friends. I am confident they'll be benefited from this site.

Posted by: what is cosmetic surgery | 2015.07.11 at 07:57 AM

Hi there friends, its impressive post concerning cultureand completely explained, keep it up all the time.

Posted by: west palm beach social marketing | 2015.07.11 at 08:01 AM

I love looking through a post that will make men and women think. Also, thank you for allowing me to comment!

Posted by: breast enlargements | 2015.07.11 at 09:17 PM

You will merely apply these financing options through very simple online method. Cash advance loans are easy and fast monetary assistance that accompanies east handling Even if you are problematic by CCJs, Individual voluntary arrangement, late obligations, missed payments, skipping involving installments, non-payments, arrears, chapter 7 and even real estate foreclosure; you are still here you are at raise the the greatest benefits from college loans for without a job! Your money is much more protected that has a credit card since the majority of credit card companies can refund your hard earned dollars if you challenge a fraudulent ask for.

Posted by: ebay.com | 2015.08.09 at 10:38 AM

Simply wish to say your article is as astonishing. The clarity in your post is just spectacular and i can assume you are an expert on this subject. Well with your permission let me to grab your feed to keep uup to date with forthcoming post. Thanks a million and please continue the gratifying work.

Posted by: Cheats For Rise Of Darkness | 2015.08.11 at 04:05 AM

You ought to be a part of a contest for one of the best sites on the internet. I am going to recommend this web site!

Posted by: like this | 2015.08.12 at 09:59 PM

I savour, result in I found just what I used to be looking for. You've ended my 4 day lengthy hunt! God Bless you man. Have a nice day. Bye

Posted by: he has a good point | 2015.08.20 at 01:49 AM

LEGO Star Wars III: The Clone Wars Missing Character Locations: Undead Geonosian. Weapons can be fused together to create more powerful equipment, which will often take certain abilities from each weapon and transfer it onto the new one. Art and Entertainment news is very useful as it takes the responsibility of giving one proper education through different information and news on different topics.

Posted by: star wars uprising Hack | 2015.09.27 at 11:14 AM

Hmm is anyone else experiencing problems with the images on this blog loading? I'm trying to find out if its a problem on my end or if it's the blog. Any responses would be greatly appreciated.

Posted by: powerful and affordable booter for xbox | 2015.10.04 at 04:43 PM

free animal sex pics

Posted by: ovebitties.com | 2015.10.24 at 08:35 PM

Hi,after reading this awesome article i am as well cheerful to share my know-how here with colleagues. http://www.forpeoplewholovehorses.com

Posted by: http://www.forpeoplewholovehorses.com | 2015.11.14 at 04:37 PM

Yesterday, while I was at work, my sister stole my iPad and tested to see if it can survive a thirty foott drop, jst so she can be a youtube sensation. My apple ipad is now broken and she has 83 views. I know this is entirely off topic but I had to share it with someone! http://www.northstargeographics.com

Posted by: http://www.northstargeographics.com | 2015.11.15 at 06:33 AM

Hi, for all time i used to check webpage posts here early in the break of day, for the reason that i enjoy to learn more and more. http://www.endeavordc.com

Posted by: http://www.endeavordc.com | 2015.11.16 at 08:23 PM

It's very effortless to find out any matter on net as compared to textbooks, as I found this paragraph at tuis site.

Posted by: http://www.shahroodi.com | 2015.11.20 at 04:15 AM

May I simply say what a relief to find someboy who really understands what they're talking about online. You certaily know how to bring a problem to light and make it important. More people must read this and understand this side off your story. I was surprised yoou are not more popular because you certainly have the gift. http://www.foodtruckseattle.com

Posted by: http://www.foodtruckseattle.com | 2015.11.21 at 05:48 PM

Hello, its fawstidious paragraph oon thee topic of edia print, we all bbe aware of media is a fantastic source of information. http://www.uniwebcv.com

Posted by: http://www.uniwebcv.com | 2015.11.22 at 11:17 AM

I'm really enjoying the design and layot of your website. It's a very asy on the eyes which makes it much more pleazsant for me to come here annd visit more often. Did you hire out a developer to create your theme? Excellent work! http://www.questwalkers.com

Posted by: http://www.questwalkers.com | 2015.11.22 at 12:22 PM

This article offers cclear idewa for the new viewers of blogging, that truly how to do running a blog. http://www.erasmuslive.com

Posted by: http://www.erasmuslive.com | 2015.11.22 at 04:51 PM

Wow, amazing blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your web site is magnificent, let alone thee content! http://www.writetechnology.net

Posted by: http://www.writetechnology.net | 2015.11.23 at 06:30 PM

At this time it looks like Expression Engie is the best blogging platform available right now. (from what I've read) Is that what you are using on your blog? http://www.aasewhitewebdesign.com

Posted by: http://www.aasewhitewebdesign.com | 2015.11.24 at 12:48 AM

I ferel that is among the such a lot important ino for me. And i am glad readeing your article. But want to remark onn few basic things, Thee website style is great, the articles is actujally excellent : D. Excellent job, cheers http://www.fascikla.net

Posted by: http://www.fascikla.net | 2015.11.24 at 05:37 AM

I am not sure where you aree getting your information, but great topic. I needs to spend some time learning more or understanding more. Thanks for magnificent info I was looking for this information for my mission. http://www.ogdenridjanovic.com

Posted by: http://www.ogdenridjanovic.com | 2015.11.26 at 08:51 AM

Its like you read my mind! You sem to know so much about this, like you wfote the book in it or something. I think that you could do with a few pics to drive the message home a bit, but other than that, this is magnificent blog. An excellent read. I'll certainly be back. http://www.femtolisp.com

Posted by: http://www.femtolisp.com | 2015.11.27 at 03:14 AM

Great post. http://www.fascikla.net

Posted by: http://www.fascikla.net | 2015.12.09 at 11:13 PM

Post a comment



(Not displayed with comment.)




TrackBack

TrackBack URL for this entry:
http://app.cocolog-nifty.com/t/trackback/2111/17208344

Listed below are links to weblogs that reference WPFの縦書き続き:

» 岩佐真悠子のプライベートヌード [岩佐真悠子のプライベートヌード]
岩佐真悠子のプライベートヌード [Read More]

Tracked on 2007.11.28 at 03:58 PM

» WPF TextBox の Visual Tree [さすらいの .NET プログラマー]
WPF の縦書きの続き にさらに続く。XamlPad で覗いてみる。 TextB [Read More]

Tracked on 2007.11.28 at 09:39 PM

« WPFの縦書き | Main | WPF Text API »