2017 © Pedro Pelรกez
 

library stringwidth

Measure string width (support Unicode east asian ambiguous width)

image

zonuexe/stringwidth

Measure string width (support Unicode east asian ambiguous width)

  • Sunday, March 22, 2015
  • by zonuexe
  • Repository
  • 1 Watchers
  • 1 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

PHP StringWidth

Measure string width (support Unicode east asian ambiguous width), (*1)

Install

composer require 'zonuexe/stringwidth:~0.1.1'

Usage

Notice: Input string must be UTF-8 encoded, (*2)

<?php

\Teto\StringWidth::asSingle('ABC'); //=> 3
\Teto\StringWidth::asDouble('ABC'); //=> 3

\Teto\StringWidth::asSingle('โ˜†โ˜†โ˜†'); //=> 3
\Teto\StringWidth::asDouble('โ˜†โ˜†โ˜†'); //=> 6

\Teto\StringWidth::asSingle('๋„์„œ๊ด€'); //=> 6
\Teto\StringWidth::asDouble('๋„์„œ๊ด€'); //=> 6

src/StringWidth/Tanasinn/*.php codes are derivatived by tanasinn/wcwidth.js at e432aeec63452e8c4d1e40e93f5f88f1bc729dca ยท saitoha/tanasinn. USAMI Kenta(@zonuexe) ported to PHP from JavaScript., (*3)

see src/StringWidth/Tanasinn/LICENSE., (*4)

***** BEGIN LICENSE BLOCK *****
Version: MPL 1.1

The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is tanasinn
The Initial Developer of the Original Code is * Hayaki Saito.
Portions created by the Initial Developer are Copyright (C) 2010 - 2011
the Initial Developer. All Rights Reserved.
***** END LICENSE BLOCK *****

src/StringWidth.php and test codes are licensed under Mozilla Public License, version 2.0, (*5)

Copyright (c) 2015 USAMI Kenta

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.

The Versions

22/03 2015

dev-master

9999999-dev

Measure string width (support Unicode east asian ambiguous width)

  Sources   Download

MPL-2.0 MPL-1.1

The Requires

  • ext-mbstring *

 

The Development Requires

by Hayaki Saito

string unicode width eastasian eaw

22/03 2015

0.1.1

0.1.1.0

Measure string width (support Unicode east asian ambiguous width)

  Sources   Download

MPL-2.0 MPL-1.1

The Requires

  • ext-mbstring *

 

The Development Requires

by Hayaki Saito

string unicode width eastasian eaw

22/03 2015

0.1.0

0.1.0.0

Measure string width

  Sources   Download

MPL-2.0 MPL-1.1

The Requires

  • ext-mbstring *

 

The Development Requires

by Hayaki Saito

string unicode width eastasian eaw