README.md in shogi_koma-0.0.1 vs README.md in shogi_koma-0.0.2
- old
+ new
@@ -1,9 +1,14 @@
# ShogiKoma [![Build Status](https://secure.travis-ci.org/myokoym/shogi_koma.png?branch=master)](http://travis-ci.org/myokoym/shogi_koma)
An image generator for Shogi's pieces (it's "ko-ma" in Japanese) for Ruby by cairo.
+It supports one or two characters.
+
+![fu1](http://myokoym.net/public/shogi_koma-fu1.png)
+![fu2](http://myokoym.net/public/shogi_koma-fu2.png)
+
## Requirements
* [Ruby](https://www.ruby-lang.org/)
* [rcairo](https://github.com/rcairo/rcairo)
* [cairo](http://cairographics.org/)
@@ -31,20 +36,25 @@
painter = ShogiKoma::Painter.new
#painter.width = 200 # as default
#painter.height = 200 # as default
#painter.font = "IPAMincho" # as default
-painter.write_to_png("歩", "fu.png")
+painter.write_to_png("歩", "shogi_koma-fu1.png")
+painter.write_to_png("歩兵", "shogi_koma-fu2.png")
```
### Draw to Cairo::Context
```ruby
require "cairo"
require "shogi_koma"
-Cairo::ImageSurface.new(:argb32, 40, 40) do |surface|
+width = 200
+height = 200
+
+Cairo::ImageSurface.new(:argb32, width, height) do |surface|
Cairo::Context.new(surface) do |context|
+ context.scale(width, height)
painter = ShogiKoma::Painter.new
#painter.font = "IPAMincho" # as default
painter.draw(context, "歩")
end
end