No commit activity in last 3 years
No release in over 3 years
A pure Ruby library to generate SVG images for Japanese bookkeeping.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 5.0
~> 10.0
~> 0.40
~> 0.11
 Project Readme

japanese-bookkeeping-svg

Build Status Gem Version MIT licensed

Generate SVG files for Japanese style bookkeeping diagrams.

⚠️ This SVG uses textLength attritube which is not be supported by some SVG viewer. Use Firefox, Batik, etc.

Usage

gem install japanese-bookkeeping-svg

仕訳

require 'japanese-bookkeeping-svg'

File.open('journal.svg', 'w') do |file|
  file.write JapaneseBookkeepingSVG.journalization(
    debits={
      現金預金: 4000
    },
    credits={
      売上: 2000,
      売掛金: 2000
    }
  ).to_s
end

T字勘定

require 'japanese-bookkeeping-svg'

File.open('t-accounts.svg', 'w') do |file|
  file.write JapaneseBookkeepingSVG.t_accounts(
    '現金預金',
    debits={
      資本金: 10000
    },
    credits={
      仕入: 2000,
      普通預金: 1234,
      諸口: 3456,
      次月繰越: 3310
    }
  ).to_s
end

Conversion to PNG with Batik

Make user.css.

text {
  font-size: 16px;
  font-family: "ヒラギノ明朝 ProN W6", "HiraMinProN-W6";
}

Execute. Set -w 2000 for changing image size to make resolutions up.

java -jar batik-1.8/batik-rasterizer-1.8.jar -w 2000 -cssUser user.css out.svg

License

japanese-bookkeeping-svg is distributed under the terms of the MIT license (see LICENSE.txt).