From 61cd5a73490948ab3c0754dd563d95ac331a50b9 Mon Sep 17 00:00:00 2001 From: eto Date: Sun, 23 Mar 2003 01:04:01 +0000 Subject: [PATCH] fix entity reference. --- doc/index.html | 2 +- t/tc_kage.rb | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100755 t/tc_kage.rb diff --git a/doc/index.html b/doc/index.html index e66fafb..db0fecd 100755 --- a/doc/index.html +++ b/doc/index.html @@ -211,7 +211,7 @@ IDSキャラクターが含まれているため、場合によってはうま

■字形合成

字形合成は、composeメソッドで行う。

-p "#x2ff0;木木".compose
+p "⿰木木".compose
 

findメソッドで、ある部品が漢字の一部として含まれている漢字群を探すことができる。 diff --git a/t/tc_kage.rb b/t/tc_kage.rb new file mode 100755 index 0000000..f1f2140 --- /dev/null +++ b/t/tc_kage.rb @@ -0,0 +1,39 @@ +#!/usr/bin/env ruby +# kage testcase by eto 2003-0318 + +require 'test/unit' +$LOAD_PATH << '../src' +require 'chise' +require 'stroke' +include CHISE +include StrokeFont + +class TC_Kage < Test::Unit::TestCase + def setup + @kage = KageFont.new + end + def test_stroke + + end + def test_kage + char = Character.get(0x4e03) #七 + font = @kage.get(0x4e03) + assert_instance_of(KageGlyph, font) + font.parse + + svg = <<"EOT" + M 50,540 950,255 + M 330,50 330,900 M 330,900 Q 330,950 380,950 M 380,950 840,950 M 840,950 Q 890,950 915,850 +EOT + strokes = KageParser.parse(svg) + #p strokes + end + def test_path + pr = PathResolver.new + assert_equal([[0, 0, 1000, 1000]], pr.parse("M 0,0 1000,1000")) + assert_equal([[0, 0, 0, 1000], [0, 1000, 1000, 1000]], pr.parse("M 0,0 0,1000 1000,1000")) +# assert_equal([[0, 0, 0.0, 0.0], [0.0, 0.0, 62.5, 437.5], [62.5, 437.5, 250.0, 750.0], [250.0, 750.0, 562.5, 937.5]], pr.parse("M 0,0 Q 0,1000 1000,1000")) + end +end + +#----------------------------------------------------------------------end. -- 1.7.10.4