Add special HTML classes for Tate-Chu-Yoko and text-orientaion.

2.1.2 2020-08-17 10:25 UTC

This package is auto-updated.

Last update: 2020-09-17 10:40:08 UTC


Wrap sequence of numbers(default is two-digit) and sequence of EXCLAMATION (QUESTION) MARKs with span.tcy in (see Tate-Chu-Yoko).

Wrap each characters of upright glyph orientation with span.upright and sideways glyph orientation with span.sideways(see UTR50).

Expected CSS;

.tcy {
	text-combine-upright: all;
.upright {
	text-orientation: upright;
.sideways {
	text-orientation: sideways;


composer install


$harusame = new Denshoch\Harusame();
// => 平成<span class="tcy">20</span>年<span class="tcy">!?</span>

// You can pass HTML string. Only text nodes within the body tag are transformed.
// => <html><head><title>平成20年!?</title></head><body>平成<span class="tcy">20</span>年<span class="tcy">!?</span></body></html>

// => <span class="upright">⓵</span><span class="upright">☂</span><span class="sideways">÷</span><span class="sideways">∴</span>


$options = array("tcyDigit" => 3);
$harusame = new Denshoch\Harusame($options);
// => <span class="tcy">10</span>円玉と<span class="tcy">100</span>円玉がある。
// or
$harusame = new Denshoch\Harusame();
$harusame.tcyDigit = 3;
// => <span class="tcy">10</span>円玉と<span class="tcy">100</span>円玉がある。
key type inital description
autoTcy boolean true Add .tcy class or not.
tcyDigit integer 2 max digits of number to add .tcy class.
autoTextOrientation boolean true Add .upright and .sideways class or not.


$ verdor/bin/phpunit