Tuesday, February 12, 2008

Tsumeshogi diagrams with Kanji, part III

I finally managed to finish PDF collection of 300 Tsumeshogi problems with pieces represented by Kanji characters (http://shogitools.googlecode.com/files/tsume_collection_0_3.pdf).

Now I am starting to validate the data. It turns out that there are few mistakes in the input data.

Missing tsume
I produced the collection from problems posted weekly on Shogi-l by Reijer Grimbergen.
There was 50 "episodes", 6 problems each which gives 300 problems. I dug the posts from our archives.
I found out that the 35th part of the series was missing from the archives -- or at least I couldn't find it.

Does anyone, by any chance has a copy of the post or the 6 problems?

Errors in definition
The second problem are errors in the definition. Some problems posted on shogi-l have clearly mistaken data:

Problem 103:
Black: S3d, S2c, P1f In hand: B, G
White: K2d, B5a, L1c, L1b, P3d, P2d
diagram

Problem 138:
Black: +B3d, B1d, N1a, L4c In hand: N
White: K2b, N1a, P1c
diagram

Problem 198:
Black: R3a, B4e, S4b In hand: R
White: K2b, G1c, S4b, N2a, L1b, P2e
diagram

Problem 297:
Black: R3f, S1d In hand: G, 2S
White: K3d, +B4b, G2e, L1a, P3b, P1d
diagram

Does somebody have any ideas how the problems should look like?


Mistakes in the problems
There could be some mistakes in the problems themselves. I found the two while browsing the archives (http://www.shogi.net/shogi-l/Archive/1993/Njan27-01.txt, http://www.shogi.net/shogi-l/Archive/1993/Njan27-02.txt). I made required corrections to problems:
12. 7l1/6k2/7p1/6p2/6N2/7+pP/9/9/9 B SGR
44. 9/6p2/5B1g1/5p2R/6k2/9/6S2/9/9 B B


If you find any errors while solving the problems, please drop a note on Shogi-l, or as a comment to this post.

Thanks in advance!

Thursday, February 7, 2008

Tsumeshogi diagrams with Kanji, part II

The delay

As I wrote earlier I had been planning to produce this version of "my" Tsumeshogi Collection for a long time now. The only thing that was putting me off was weird interpretation of "reference-orientation" XSL-FO attribute. The specification describes it as follows:

The reference-orientation property defines the direction for top for the content-rectangle of the reference-area.




Property Values
ValueDescription
0Default. The orientation of this area has the same orientation as the containing reference-area
90The orientation is rotated 90 degrees from the orientation of the containing reference-area
180The orientation is rotated 180 degrees from the orientation of the containing reference-area
270The orientation is rotated 270 degrees from the orientation of the containing reference-area
-90Same as specifying 270
-180Same as specifying 180
-270Same as specifying 90

The first problem was that in Apache FOP using -90, -180 and -270 as reference-orientation instead of 90, 180 and 270 resulted in content being drawn outside its block.

The first results

The commercial equivalent of FOP, RenderX' XEP, did better in this area. I used to produce my first version of the collection with Kanji for the Shogi pieces.

The power of the Open Source community

Although XEP is a decent piece of software (and the company provides free personal edition) I decided to keep on looking for open source alternative.

I described what I am doing and I asked the question about the strange FOP behaviour on public w3.org lists. I didn't have to wait long for the answer. Jeremias Maerki informed me that the situation I described is a known bug in Apache FOP which hasn't been resolved yet.

Bad news, but at least I finally knew what is going on...

The same day, few hours later, Jeremias posted his second answer: he fixed the bug!

After downloading the newest version of FOP from Apache's site I am now able to produce the collection the way I wanted to.

Monday, February 4, 2008

Tsumeshogi diagrams with Kanji

I have just found a PDF (from xsl-fo) renderer which properly handles rotated text in tables.

I produced Tsumeshogi collection with 300 problems using "international" symbols. After that I decided to do the same thing using Kanji characters.

The PDF generator I used, Apache FOP, acted strange when it came to rotated characters (the idea was to use Kanji representation for Shogi diagrams, black pieces heading up, white pieces upside down). So I gave up.

Few days ago I found out, that there is a commercial implementation of PDF renderer (fortunately, they also provied "personal licence") -- RenderX's XEP (http://www.renderx.com/tools/xep.html).

Thank's to this piece of software I will soon be able to produce my Tsumeshogi collection using Kanji characters.

Just give me a day or two...