Coder Social home page Coder Social logo

vjap's Introduction

vjap

Androidの日本語縦書き用ライブラリ

縦書きフォントのないANdroidで縦書き表示する為にcanvasに位置を調整して直接描画しています。

Alt Text  Alt Text

##主な対応機能

-ページスクロールバー

-ページ送りのフリップ/クリック切り替え

-挿絵の表示

-改行時の禁則処理

-ルビ振り

-文字フォント変更(デフォルトフォントとIPA明朝フォントに対応)

-文字サイズ変更

-文字色変更

##基本的な使い方 xmlにvTextLayoutを配置してinflateし、vTextLayout.initContent(title,text)を呼び出す。

xml

<jp.taizan.android.vjap.VTextLayout
    android:id="@+id/vTextLayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" />

Activity

import jp.taizan.android.vjap.VTextLayout;
~
~
vTextLayout = (VTextLayout) findViewById(R.id.vTextLayout);
vTextLayout.initContent("たいとる","〜〜本文〜〜");

###ページスクロールバー 画面下部をクリックするとスクロールバーが表示され、ページ送りが可能です。 画面下部にプログレスバーが回っている時はページ数計算中で、この時はスクロールバーが表示できません。

###ページ送りのフリップ/クリック切り替え 下記の関数でフリップを無効化し、クリック送りに切り替えられます。解除の時はfalseを渡してください。

vTextLayout.setScrollDisabled(true);

###挿絵の表示 本文中に%$画像のURL$という形式でURLを設定すると改ページして画像を表示します。

###ルビ振り 基本的に青空文庫の形式で、|ルビ対象《るび》という形式で本文を入力すればOKです。

###フォントの設定 下記のようにフォントが指定でき、IPAフォントを設定するとSDにIPAフォントをダウンロードしてフォントの設定を切り替えます。 ダウンロードされていれば、以降は単に切り替え可能です。

vTextLayout.setFont( VTextLayout.Font.IPA);
vTextLayout.setFont( VTextLayout.Font.NORMAL);

サイズや色を指定する場合は

vTextLayout.setFontSize(size);
vTextLayout.setColor( "white" , "black" ); //白文字黒背景

vjap's People

Contributors

taizan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.