├── debian ├── compat ├── source │ └── format ├── rules ├── control ├── copyright └── changelog.in ├── po ├── LINGUAS ├── meson.build ├── POTFILES ├── ja.po └── it.po ├── po.school ├── LINGUAS ├── meson.build ├── POTFILES ├── ja.po └── it.po ├── man ├── meson.build ├── ja │ ├── meson.build │ └── furiganapad.1 └── furiganapad.1 ├── docs ├── icon.png ├── normal.png ├── school.png ├── screenshot.png ├── screenshot.webm ├── screenshot_en.png ├── furiganapad.flathub.png ├── update ├── hiragana_ime.md ├── meson.build ├── specification.md ├── index.md ├── template.html ├── install.md ├── specification.html ├── index.html ├── hiragana_ime.html ├── usage.md ├── md2html.py ├── install.html ├── default.css └── usage.html ├── data ├── icons │ ├── hicolor │ │ ├── 128x128 │ │ │ └── apps │ │ │ │ └── com.esrille.furiganapad.png │ │ ├── 256x256 │ │ │ └── apps │ │ │ │ └── com.esrille.furiganapad.png │ │ └── 96x96 │ │ │ └── apps │ │ │ └── com.esrille.furiganapad.png │ └── meson.build ├── com.esrille.furiganapad.desktop.in ├── meson.build └── com.esrille.furiganapad.metainfo.xml.in ├── src ├── furiganapad.gresource.xml ├── furiganapad.in ├── meson.build ├── main.py ├── package.py.in ├── furiganapad.css ├── breaker.py ├── furiganapad.menu.ui ├── application.py └── window.py ├── meson ├── update-changelog.sh └── postinstall.py ├── meson.build ├── README.txt ├── NOTICE ├── README_en.md ├── README.md ├── tools └── convert_to_tag.py ├── CONTRIBUTING.md ├── furiganapad.spec.in └── COPYING /debian/compat: -------------------------------------------------------------------------------- 1 | 11 2 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | it 2 | ja 3 | -------------------------------------------------------------------------------- /po.school/LINGUAS: -------------------------------------------------------------------------------- 1 | it 2 | ja 3 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /po/meson.build: -------------------------------------------------------------------------------- 1 | i18n.gettext('furiganapad', preset: 'glib') 2 | -------------------------------------------------------------------------------- /man/meson.build: -------------------------------------------------------------------------------- 1 | install_man('furiganapad.1') 2 | 3 | subdir('ja') 4 | -------------------------------------------------------------------------------- /po.school/meson.build: -------------------------------------------------------------------------------- 1 | i18n.gettext('furiganapad.school', preset: 'glib') 2 | -------------------------------------------------------------------------------- /docs/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/esrille/furiganapad/HEAD/docs/icon.png -------------------------------------------------------------------------------- /docs/normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/esrille/furiganapad/HEAD/docs/normal.png -------------------------------------------------------------------------------- /docs/school.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/esrille/furiganapad/HEAD/docs/school.png -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | %: 4 | dh $@ --buildsystem=meson --with python3 5 | -------------------------------------------------------------------------------- /docs/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/esrille/furiganapad/HEAD/docs/screenshot.png -------------------------------------------------------------------------------- /docs/screenshot.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/esrille/furiganapad/HEAD/docs/screenshot.webm -------------------------------------------------------------------------------- /docs/screenshot_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/esrille/furiganapad/HEAD/docs/screenshot_en.png -------------------------------------------------------------------------------- /docs/furiganapad.flathub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/esrille/furiganapad/HEAD/docs/furiganapad.flathub.png -------------------------------------------------------------------------------- /man/ja/meson.build: -------------------------------------------------------------------------------- 1 | install_data('furiganapad.1', install_dir: join_paths(get_option('mandir'), 'ja', 'man1')) 2 | -------------------------------------------------------------------------------- /data/icons/hicolor/128x128/apps/com.esrille.furiganapad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/esrille/furiganapad/HEAD/data/icons/hicolor/128x128/apps/com.esrille.furiganapad.png -------------------------------------------------------------------------------- /data/icons/hicolor/256x256/apps/com.esrille.furiganapad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/esrille/furiganapad/HEAD/data/icons/hicolor/256x256/apps/com.esrille.furiganapad.png -------------------------------------------------------------------------------- /data/icons/hicolor/96x96/apps/com.esrille.furiganapad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/esrille/furiganapad/HEAD/data/icons/hicolor/96x96/apps/com.esrille.furiganapad.png -------------------------------------------------------------------------------- /po/POTFILES: -------------------------------------------------------------------------------- 1 | data/com.esrille.furiganapad.desktop.in 2 | data/com.esrille.furiganapad.metainfo.xml.in 3 | src/application.py 4 | src/main.py 5 | src/textbuffer.py 6 | src/textview.py 7 | src/window.py 8 | src/furiganapad.menu.ui 9 | -------------------------------------------------------------------------------- /po.school/POTFILES: -------------------------------------------------------------------------------- 1 | data/com.esrille.furiganapad.desktop.in 2 | data/com.esrille.furiganapad.metainfo.xml.in 3 | src/application.py 4 | src/main.py 5 | src/textbuffer.py 6 | src/textview.py 7 | src/window.py 8 | src/furiganapad.menu.ui 9 | -------------------------------------------------------------------------------- /src/furiganapad.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | furiganapad.menu.ui 5 | 6 | 7 | -------------------------------------------------------------------------------- /data/com.esrille.furiganapad.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Name=FuriganaPad 4 | Comment=Write Japanese text with Ruby annotations easily 5 | Icon=com.esrille.furiganapad 6 | Exec=furiganapad %F 7 | Terminal=false 8 | Categories=Utility;TextEditor; 9 | MimeType=text/plain; 10 | -------------------------------------------------------------------------------- /docs/update: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ./md2html.py index.md specification.md install.md & 3 | ./md2html.py install.md index.md usage.md & 4 | ./md2html.py usage.md install.md hiragana_ime.md & 5 | ./md2html.py hiragana_ime.md usage.md specification.md & 6 | ./md2html.py specification.md hiragana_ime.md index.md & 7 | wait 8 | -------------------------------------------------------------------------------- /meson/update-changelog.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | version=$1 4 | source_version=`echo -n $version | tr '~' '-'` 5 | 6 | LC_TIME=C 7 | 8 | if [ -v MESON_DIST_ROOT ]; then 9 | cd $MESON_DIST_ROOT 10 | fi 11 | 12 | # update spec 13 | date=`date -R` 14 | s=`cat debian/changelog.in` 15 | eval "echo \"$s\"" > debian/changelog 16 | 17 | # update changelog 18 | date=`date '+%a %b %d %Y'` 19 | s=`cat furiganapad.spec.in` 20 | eval "echo \"$s\"" > furiganapad.spec 21 | -------------------------------------------------------------------------------- /docs/hiragana_ime.md: -------------------------------------------------------------------------------- 1 | # ひらがなIMEとの連動れんどう 2 | 3 |  「ふりがなパッド」は、「ひらがなIME」の漢字かんじ辞書じしょの設定せっていに応おうじて、メニューの表示ひょうじをきりかえます。 4 |  漢字かんじ辞書じしょが小学校しょうがっこう1年生ねんせいから6年生ねんせい用ようであれば、小学生しょうがくせいむけのメニューを表示ひょうじします。 5 | 6 | ![小学生しょうがくせいむけメニュー](school.png) 7 | 8 |  中学生ちゅうがくせい用よう以上いじょうの漢字かんじ辞書じしょが設定せっていされていれば、通常つうじょうのメニューを表示ひょうじします。 9 | 10 | ![標準ひょうじゅんメニュー](normal.png) 11 | 12 |  どちらのメニュー表示ひょうじになっていても、つかえる機能きのうはおなじです。 13 | -------------------------------------------------------------------------------- /docs/meson.build: -------------------------------------------------------------------------------- 1 | pkgdatadir = get_option('prefix') / get_option('datadir') / meson.project_name() 2 | moduledir = pkgdatadir / 'docs' 3 | 4 | furiganapad_docs = [ 5 | 'default.css', 6 | 'hiragana_ime.html', 7 | 'index.html', 8 | 'install.html', 9 | 'specification.html', 10 | 'usage.html', 11 | 'furiganapad.flathub.png', 12 | 'icon.png', 13 | 'normal.png', 14 | 'school.png', 15 | 'screenshot.webm' 16 | ] 17 | 18 | install_data(furiganapad_docs, install_dir: moduledir) 19 | -------------------------------------------------------------------------------- /meson.build: -------------------------------------------------------------------------------- 1 | project('furiganapad', 2 | version: '0.7.2', 3 | meson_version: '>= 0.53.0', 4 | default_options: [ 'warning_level=2', 'werror=false', ], 5 | ) 6 | 7 | i18n = import('i18n') 8 | gnome = import('gnome') 9 | 10 | subdir('data') 11 | subdir('docs') 12 | subdir('man') 13 | subdir('po') 14 | subdir('po.school') 15 | subdir('src') 16 | 17 | meson.add_dist_script('meson/update-changelog.sh', meson.project_version()) 18 | 19 | meson.add_install_script('meson/postinstall.py') 20 | -------------------------------------------------------------------------------- /meson/postinstall.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from os import environ, path 4 | from subprocess import call 5 | 6 | prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/') 7 | datadir = path.join(prefix, 'share') 8 | destdir = environ.get('DESTDIR', '') 9 | 10 | # Package managers set this so we don't need to run 11 | if not destdir: 12 | print('Updating icon cache...') 13 | call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')]) 14 | 15 | print('Updating desktop database...') 16 | call(['update-desktop-database', '-q', path.join(datadir, 'applications')]) 17 | -------------------------------------------------------------------------------- /docs/specification.md: -------------------------------------------------------------------------------- 1 | # ファイルの仕様しようと応用おうよう 2 | 3 | ## ファイルの仕様しよう 4 | 5 |  「ふりがなパッド」は、UTF-8でエンコードされたテキストファイルのよみかきができます。 6 |  ふりがなは、[ユニコードのルビ用ようのコードポイントU+FFF9からU+FFFB](https://www.unicode.org/charts/nameslist/n_FFF0.html)をつかって保存ほぞんしています。 7 | 8 | ## 応用おうよう 9 | 10 |  ユニコードのルビをHTMLのrubyタグに変換へんかんしたりするのはかんたんです。 11 | つぎの例れいでは、「ふりがなパッド」でかいたREADME.txtを、スクリプトをつかって、README.mdに変換へんかんしています。 12 | ``` 13 | $ tools/convert_to_tag.py README.txt README.md 14 | ``` 15 | [convert_to_tag.py](https://github.com/esrille/furiganapad/blob/main/tools/convert_to_tag.py)スクリプトも「ふりがなパッド」のレポジトリのなかにおいてあります。 16 | -------------------------------------------------------------------------------- /data/icons/meson.build: -------------------------------------------------------------------------------- 1 | application_id = 'com.esrille.furiganapad' 2 | 3 | icon_96_dir = 'hicolor' / '96x96' / 'apps' 4 | install_data( 5 | icon_96_dir / ('@0@.png').format(application_id), 6 | install_dir: get_option('datadir') / 'icons' / icon_96_dir 7 | ) 8 | 9 | icon_128_dir = 'hicolor' / '128x128' / 'apps' 10 | install_data( 11 | icon_128_dir / ('@0@.png').format(application_id), 12 | install_dir: get_option('datadir') / 'icons' / icon_128_dir 13 | ) 14 | 15 | icon_256_dir = 'hicolor' / '256x256' / 'apps' 16 | install_data( 17 | icon_256_dir / ('@0@.png').format(application_id), 18 | install_dir: get_option('datadir') / 'icons' / icon_256_dir 19 | ) 20 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # はじめに 2 | 3 |  「ふりがなパッド」は、ふりがなをうった文章ぶんしょうをかんたんにつくれるテキスト エディターです。 4 | 「[ひらがなIME](https://github.com/esrille/ibus-hiragana)」といっしょにつかうと、入力にゅうりょくした漢字かんじに自動的じどうてきにふりがなをふっていきます。 5 | 6 | 10 | 11 | ## ふりがなについて 12 |  こども用ようの本ほんには、すべての漢字かんじにふりがなをふってある本ほんもすくなくありません。そうしたふりがなのつけかたを「総そうふりがな」とか「総そうルビ」といいます。 13 |  さいきんは、おとなも「やさしい日本語にほんご」でかいた文章ぶんしょうをみたり、かいたりする機会きかいがふえてきました。「やさしい日本語にほんご」の文章ぶんしょうも漢字かんじにふりがながふってあります。 14 |  いまはウェブブラウザも、ふりがなをふつうに表示ひょうじできるようになっています。「ふりがなパッド」は、総そうルビの文章ぶんしょうをかんたんに作成さくせいしたり編集へんしゅうしたりできるようにつくられています。 15 | 16 |
17 |
Copyright 2019-2024 Esrille Inc. 18 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | # ふりがなパッド 2 |  「ふりがなパッド」は、ふりがなをうった文章ぶんしょうをかんたんにつくれるテキストエディターです。「[ひらがなIME](https://github.com/esrille/ibus-hiragana)」といっしょにつかうと、入力にゅうりょくした漢字かんじに自動的じどうてきにふりがなをつけていきます。 3 | 4 | ![「ふりがなパッド」のスクリーンショット](https://esrille.github.io/furiganapad/screenshot.png) 5 | 6 | ## ふりがなについて 7 |  こども用ようの本ほんには、すべての漢字かんじにふりがなをふってある本ほんもすくなくありません。そうしたふりがなのつけかたを「総そうふりがな」とか「総そうルビ」といいます。 8 | 9 |  さいきんでは、「やさしい日本語にほんご」でかいた文章ぶんしょうをみたり、かいたりする機会きかいがふえてきました。「やさしい日本語にほんご」の文章ぶんしょうも漢字かんじにふりがながふってあります。 10 | 11 |  いまではウェブブラウザも、ふりがなを表示ひょうじできるようになっています。「ふりがなパッド」は、総そうルビの文章ぶんしょうをかんたんに作成さくせいしたり編集へんしゅうしたりできるようにつくられています。 12 | 13 | ## 資料しりょう 14 | 15 | - [ふりがなパッドの手てびき](https://esrille.github.io/furiganapad/) 16 | - [ふりがなパッドの開発かいはつについて](https://github.com/esrille/furiganapad/blob/master/CONTRIBUTING.md) 17 | -------------------------------------------------------------------------------- /src/furiganapad.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 2020-2024 Esrille Inc. 4 | # 5 | # This library is free software; you can redistribute it and/or 6 | # modify it under the terms of the GNU Lesser General Public 7 | # License as published by the Free Software Foundation; either 8 | # version 2.1 of the License, or (at your option) any later version. 9 | # 10 | # This library is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public 16 | # License along with this library; if not, see . 17 | 18 | exec @PYTHON@ -O @pkgdatadir@/src/main.py $@ 19 | -------------------------------------------------------------------------------- /man/ja/furiganapad.1: -------------------------------------------------------------------------------- 1 | .TH FURIGANAPAD "1" "2024年5月" "furiganapad 0.7.0" "ユーザーコマンド" 2 | .SH 名前 3 | \fBfuriganapad\fP \- ふりがなつきの文章用のテキストエディター 4 | .SH 説明 5 | .B ふりがなパッド 6 | は、ふりがなをうった文章をかんたんにつくれるテキスト エディターです。 7 | ひらがなIMEとあわせてつかうと、漢字変換をしたときに漢字に自動的にふりがなをつけられます。 8 | .SS "用法:" 9 | .IP 10 | furiganapad [オプション…] 11 | .SS "ヘルプのオプション:" 12 | .TP 13 | \-?, \fB\-\-help\fR 14 | ヘルプのオプションを表示する 15 | .TP 16 | \fB\-\-help\-all\fR 17 | ヘルプのオプションをすべて表示する 18 | .TP 19 | \fB\-\-help\-gapplication\fR 20 | GApplication のオプションを表示する 21 | .TP 22 | \fB\-\-help\-gtk\fR 23 | GTK+ のオプションを表示する 24 | .SS "アプリケーションのオプション:" 25 | .TP 26 | \fB\-x\fR, \fB\-\-window\-x\fR=\fI\,x\/\fR 27 | ウインドウの x 座標 28 | .TP 29 | \fB\-y\fR, \fB\-\-window\-y\fR=\fI\,y\/\fR 30 | ウインドウの y 座標 31 | .TP 32 | \fB\-w\fR, \fB\-\-window\-width\fR=\fI\,w\/\fR 33 | ウインドウの幅 34 | .TP 35 | \fB\-h\fR, \fB\-\-window\-height\fR=\fI\,h\/\fR 36 | ウインドウの高さ 37 | .TP 38 | \fB\-v\fR, \fB\-\-version\fR 39 | バージョン番号を表示する 40 | .TP 41 | \fB\-\-display\fR=\fI\,DISPLAY\/\fR 42 | 使用する X のディスプレイを指定する 43 | -------------------------------------------------------------------------------- /data/meson.build: -------------------------------------------------------------------------------- 1 | metainfo_file = i18n.merge_file ( 2 | input: 'com.esrille.furiganapad.metainfo.xml.in', 3 | output: 'com.esrille.furiganapad.metainfo.xml', 4 | po_dir: '../po', 5 | install: true, 6 | install_dir: get_option('datadir') / 'metainfo' 7 | ) 8 | 9 | # Validate metainfo 10 | appstreamcli = find_program('appstreamcli', required: false) 11 | if appstreamcli.found() 12 | test( 13 | 'validate-metainfo', appstreamcli, 14 | args: [ 15 | 'validate', '--no-net', '--explain', metainfo_file.full_path() 16 | ] 17 | ) 18 | endif 19 | 20 | desktop_file = i18n.merge_file( 21 | input: 'com.esrille.furiganapad.desktop.in', 22 | output: 'com.esrille.furiganapad.desktop', 23 | type: 'desktop', 24 | po_dir: '../po', 25 | install: true, 26 | install_dir: get_option('datadir') / 'applications' 27 | ) 28 | 29 | desktop_utils = find_program('desktop-file-validate', required: false) 30 | if desktop_utils.found() 31 | test('Validate desktop file', desktop_utils, args: [desktop_file]) 32 | endif 33 | 34 | subdir('icons') 35 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: furiganapad 2 | Section: editors 3 | Priority: optional 4 | Maintainer: Esrille Inc. 5 | Build-Depends: 6 | appstream, 7 | debhelper (>=11), 8 | desktop-file-utils, 9 | dh-python, 10 | gtk-update-icon-cache, 11 | libglib2.0-dev-bin, 12 | meson (>=0.53), 13 | python3-dev, 14 | pkg-config 15 | Standards-Version: 4.5.0 16 | Homepage: https://github.com/esrille/furiganapad 17 | Vcs-Git: https://github.com/esrille/furiganapad.git 18 | Vcs-Browser: https://github.com/esrille/furiganapad 19 | 20 | Package: furiganapad 21 | Architecture: all 22 | Depends: 23 | ${misc:Depends}, 24 | ${python3:Depends}, 25 | fonts-noto-cjk, 26 | gir1.2-gtk-3.0, 27 | gir1.2-pango-1.0 (>= 1.44.0), 28 | python3-gi, 29 | python3-gi-cairo, 30 | python3-icu, 31 | yelp 32 | Recommends: ibus-hiragana (>= 0.15.5) 33 | Description: text editor for Japanese texts with ruby characters 34 | FuriganaPad can be used to edit Japanese texts with ruby characters. 35 | Ruby characters are automatically placed above Kanji characters when 36 | converting Hiragana characters into Kanji characters by using 37 | Hiragana IME for IBus. 38 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | FuriganaPad 2 | Copyright 2019-2023 Esrille Inc. 3 | https://github.com/esrille/furiganapad 4 | 5 | This product includes software developed at Esrille Inc. 6 | . 7 | 8 | Except as otherwise noted, the content of this software are licensed 9 | under the GNU Lesser General Public License. 10 | 11 | Please consult, 12 | CONTRIBUTING.md 13 | for how to contribute to this software. 14 | 15 | == Esrille Logo Marks == 16 | 17 | Esrille logo marks are trademarks of Esrille Inc. All rights reserved. 18 | 19 | Esrille logo marks, including the es shield logo, are special trademarks 20 | to identify the products being developed and distributed by Esrille Inc. 21 | 22 | Esrille logo marks can be used by anyone if that use of the logo marks 23 | is nominative. The "nominative use" authorizes everyone (even commercial 24 | companies) to use the trademark of another if: 25 | 26 | 1. The product or service cannot be readily identified without use of 27 | the trademark; 28 | 2. The user only uses as much of the mark as is necessary to identify 29 | the product or service; and, 30 | 3. The user does nothing to suggest sponsorship or endorsement by the 31 | trademark holder. 32 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: furiganapad 3 | Source: https://github.com/esrille/furiganapad 4 | 5 | Files: * 6 | Copyright: 2019-2023 Esrille Inc. 7 | License: LGPL-2.1+ 8 | 9 | License: LGPL-2.1+ 10 | This library is free software; you can redistribute it and/or 11 | modify it under the terms of the GNU Lesser General Public 12 | License as published by the Free Software Foundation; either 13 | version 2.1 of the License, or (at your option) any later version. 14 | . 15 | This library is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | Lesser General Public License for more details. 19 | . 20 | You should have received a copy of the GNU Lesser General Public 21 | License along with this library; if not, write to the Free Software 22 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 23 | . 24 | On Debian systems, the full text of the GNU Lesser General Public 25 | License version 2.1 can be found in the file 26 | `/usr/share/common-licenses/LGPL-2.1'. 27 | -------------------------------------------------------------------------------- /man/furiganapad.1: -------------------------------------------------------------------------------- 1 | .TH FURIGANAPAD "1" "May 2024" "furiganapad 0.7.0" "User Commands" 2 | .SH NAME 3 | \fBfuriganapad\fP \- text editor for Japanese texts with ruby characters 4 | .SH DESCRIPTION 5 | .B furiganapad 6 | can be used to edit Japanese texts with ruby characters. 7 | Ruby characters are automatically placed above Kanji characters when 8 | converting Hiragana characters into Kanji characters by using 9 | Hiragana IME for IBus. 10 | .SS "Usage:" 11 | .IP 12 | furiganapad [OPTION?] 13 | .SS "Help Options:" 14 | .TP 15 | \-?, \fB\-\-help\fR 16 | Show help options 17 | .TP 18 | \fB\-\-help\-all\fR 19 | Show all help options 20 | .TP 21 | \fB\-\-help\-gapplication\fR 22 | Show GApplication options 23 | .TP 24 | \fB\-\-help\-gtk\fR 25 | Show GTK+ Options 26 | .SS "Application Options:" 27 | .TP 28 | \fB\-x\fR, \fB\-\-window\-x\fR=\fI\,x\/\fR 29 | Initial window x position 30 | .TP 31 | \fB\-y\fR, \fB\-\-window\-y\fR=\fI\,y\/\fR 32 | Initial window y position 33 | .TP 34 | \fB\-w\fR, \fB\-\-window\-width\fR=\fI\,w\/\fR 35 | Initial window width 36 | .TP 37 | \fB\-h\fR, \fB\-\-window\-height\fR=\fI\,h\/\fR 38 | Initial window height 39 | .TP 40 | \fB\-v\fR, \fB\-\-version\fR 41 | Print version information 42 | .TP 43 | \fB\-\-display\fR=\fI\,DISPLAY\/\fR 44 | X display to use 45 | -------------------------------------------------------------------------------- /src/meson.build: -------------------------------------------------------------------------------- 1 | pkgdatadir = get_option('prefix') / get_option('datadir') / meson.project_name() 2 | moduledir = pkgdatadir / 'src' 3 | gnome = import('gnome') 4 | 5 | gnome.compile_resources('furiganapad', 6 | 'furiganapad.gresource.xml', 7 | gresource_bundle: true, 8 | install: true, 9 | install_dir: pkgdatadir, 10 | ) 11 | 12 | python = import('python') 13 | 14 | conf = configuration_data() 15 | conf.set('PYTHON', python.find_installation('python3').path()) 16 | conf.set('PACKAGE_NAME', meson.project_name()) 17 | conf.set('VERSION', meson.project_version()) 18 | conf.set('prefix', get_option('prefix')) 19 | conf.set('localedir', get_option('prefix') / get_option('localedir')) 20 | conf.set('pkgdatadir', pkgdatadir) 21 | 22 | configure_file( 23 | input: 'furiganapad.in', 24 | output: 'furiganapad', 25 | configuration: conf, 26 | install: true, 27 | install_dir: get_option('bindir'), 28 | install_mode: 'r-xr-xr-x' 29 | ) 30 | 31 | configure_file( 32 | input: 'package.py.in', 33 | output: 'package.py', 34 | configuration: conf, 35 | install: true, 36 | install_dir: moduledir, 37 | install_mode: 'rw-r--r--' 38 | ) 39 | 40 | furiganapad_sources = [ 41 | 'application.py', 42 | 'breaker.py', 43 | 'furiganapad.css', 44 | 'main.py', 45 | 'textbuffer.py', 46 | 'textview.py', 47 | 'window.py', 48 | ] 49 | 50 | install_data(furiganapad_sources, install_dir: moduledir) 51 | -------------------------------------------------------------------------------- /README_en.md: -------------------------------------------------------------------------------- 1 | # FuriganaPad 2 | 3 | FuriganaPad allows you to easily write Japanese text with Ruby annotations. With [Hiragana IME for IBus](https://github.com/esrille/ibus-hiragana), FuriganaPad automatically adds Ruby characters above Kanji as you type. 4 | 5 | ![screenshot](https://esrille.github.io/furiganapad/screenshot_en.png) 6 | 7 | ## About Ruby annotations 8 | 9 | Kanji can be particularly challenging to read, especially for children in Japan. In Japan, children learn over a thousand Kanji characters during their six years of elementary school. Japanese books for children often include Ruby annotations in _Hiragana_, known as _Furigana_, on all Kanji characters. This method of adding _Furigana_ is known as '_Sô Furigana_' or 'Total Ruby.' 10 | 11 | Recently, there has been an increase in opportunities to see and write sentences in plain, easy Japanese, known as ‘_Yasashii Nihongo_.’ Easy Japanese is also typically written with Total Ruby. _Furigana_ is also helpful for people with dyslexia. 12 | 13 | These days, web browsers are capable of displaying _Furigana_. However, we don't often see content in Total Ruby due to the difficulty in content creation. FuriganaPad is designed to help you easily create and change texts with Total Ruby. 14 | 15 | ## Reference 16 | 17 | - [FuriganaPad Guide](https://esrille.github.io/furiganapad/) 18 | - [Contributing](https://github.com/esrille/furiganapad/blob/master/CONTRIBUTING.md) 19 | -------------------------------------------------------------------------------- /src/main.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019-2024 Esrille Inc. 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, see . 16 | 17 | import gettext 18 | import locale 19 | import logging 20 | import os 21 | import signal 22 | import sys 23 | 24 | from gi.repository import GLib 25 | 26 | import package 27 | from application import Application 28 | 29 | 30 | GLib.set_prgname(package.get_name()) 31 | LOGGER = logging.getLogger(__name__) 32 | 33 | 34 | def main(): 35 | # Create user specific data directory 36 | user_datadir = package.get_user_datadir() 37 | os.makedirs(user_datadir, exist_ok=True) 38 | 39 | if __debug__: 40 | logging.basicConfig(level=logging.DEBUG) 41 | 42 | app = Application() 43 | signal.signal(signal.SIGINT, signal.SIG_DFL) 44 | exit_status = app.run(sys.argv) 45 | sys.exit(exit_status) 46 | 47 | 48 | if __name__ == '__main__': 49 | locale.bindtextdomain(package.get_name(), package.get_localedir()) 50 | gettext.bindtextdomain(package.get_name(), package.get_localedir()) 51 | main() 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ふりがなパッド 2 |  「ふりがなパッド」は、ふりがなをうった文章(ぶんしょう)をかんたんにつくれるテキストエディターです。「[ひらがなIME](https://github.com/esrille/ibus-hiragana)」といっしょにつかうと、入力(にゅうりょく)した漢字(かんじ)自動的(じどうてき)にふりがなをつけていきます。 3 | 4 | ![「ふりがなパッド」のスクリーンショット](https://esrille.github.io/furiganapad/screenshot.png) 5 | 6 | ## ふりがなについて 7 |  こども(よう)(ほん)には、すべての漢字(かんじ)にふりがなをふってある(ほん)もすくなくありません。そうしたふりがなのつけかたを「(そう)ふりがな」とか「(そう)ルビ」といいます。 8 | 9 |  さいきんでは、「やさしい日本語(にほんご)」でかいた文章(ぶんしょう)をみたり、かいたりする機会(きかい)がふえてきました。「やさしい日本語(にほんご)」の文章(ぶんしょう)漢字(かんじ)にふりがながふってあります。 10 | 11 |  いまではウェブブラウザも、ふりがなを表示(ひょうじ)できるようになっています。「ふりがなパッド」は、(そう)ルビの文章(ぶんしょう)をかんたんに作成(さくせい)したり編集(へんしゅう)したりできるようにつくられています。 12 | 13 | ## 資料(しりょう) 14 | 15 | - [ふりがなパッドの()びき](https://esrille.github.io/furiganapad/) 16 | - [ふりがなパッドの開発(かいはつ)について](https://github.com/esrille/furiganapad/blob/master/CONTRIBUTING.md) 17 | -------------------------------------------------------------------------------- /docs/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {title} ― ふりがなパッド 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 25 | 26 | 27 | 43 |
44 | {body} 45 |
46 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /tools/convert_to_tag.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright (C) 2019 Esrille Inc. 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU Lesser General Public 8 | # License as published by the Free Software Foundation; either 9 | # version 2.1 of the License, or (at your option) any later version. 10 | # 11 | # This library is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | # Lesser General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public 17 | # License along with this library; if not, see . 18 | 19 | import sys 20 | 21 | 22 | IAA = '\uFFF9' # IAA (INTERLINEAR ANNOTATION ANCHOR) 23 | IAS = '\uFFFA' # IAS (INTERLINEAR ANNOTATION SEPARATOR) 24 | IAT = '\uFFFB' # IAT (INTERLINEAR ANNOTATION TERMINATOR) 25 | 26 | 27 | class Converter: 28 | 29 | def __init__(self): 30 | self.tr = str.maketrans({ 31 | IAA: '', 32 | IAS: '(', 33 | IAT: ')' 34 | }) 35 | 36 | def convert_line(self, line): 37 | return line.translate(self.tr) 38 | 39 | def convert(self, source, destination): 40 | with open(destination, 'w') as destination_file: 41 | with open(source, 'r') as source_file: 42 | for line in source_file: 43 | destination_file.write(self.convert_line(line)) 44 | 45 | 46 | if __name__ == '__main__': 47 | if len(sys.argv) < 3: 48 | sys.exit(0) 49 | 50 | converter = Converter() 51 | converter.convert(sys.argv[1], sys.argv[2]) 52 | -------------------------------------------------------------------------------- /src/package.py.in: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2020-2024 Esrille Inc. 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, see . 16 | 17 | import gettext 18 | import os 19 | 20 | from gi.repository import GLib, Gio 21 | 22 | 23 | HIRAGANA_IME_KEY = 'org.freedesktop.ibus.engine.hiragana' 24 | 25 | 26 | def get_name(): 27 | return '@PACKAGE_NAME@' 28 | 29 | 30 | def get_version(): 31 | return '@VERSION@' 32 | 33 | 34 | def get_prefix(): 35 | return '@prefix@' 36 | 37 | 38 | def get_datadir(): 39 | return '@pkgdatadir@' 40 | 41 | 42 | def get_user_datadir(): 43 | return os.path.join(GLib.get_user_data_dir(), '@PACKAGE_NAME@') 44 | 45 | 46 | def get_localedir(): 47 | return '@localedir@' 48 | 49 | 50 | def get_domain(): 51 | source = Gio.SettingsSchemaSource.get_default() 52 | if source.lookup(HIRAGANA_IME_KEY, True): 53 | config = Gio.Settings.new(HIRAGANA_IME_KEY) 54 | path = config.get_string('dictionary') 55 | path = os.path.basename(path) 56 | if path in ('restrained.1.dic', 'restrained.2.dic', 'restrained.3.dic', 57 | 'restrained.4.dic', 'restrained.5.dic', 'restrained.6.dic'): 58 | return get_name() + '.school' 59 | return get_name() 60 | 61 | 62 | def _(text): 63 | return gettext.dgettext(get_domain(), text) 64 | -------------------------------------------------------------------------------- /data/com.esrille.furiganapad.metainfo.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.esrille.furiganapad 4 | CC0-1.0 5 | Apache-2.0 6 | FuriganaPad 7 | Write Japanese text with Ruby annotations easily 8 | 9 | Esrille Inc. 10 | 11 | 12 |

13 | With Hiragana IME for IBus, FuriganaPad automatically puts Ruby characters 14 | above Kanji as you type them. 15 |

16 |
17 | com.esrille.furiganapad.desktop 18 | 19 | https://github.com/esrille/furiganapad 20 | 21 | 22 | https://esrille.github.io/furiganapad/screenshot_en.png 23 | https://esrille.github.io/furiganapad/screenshot.png 24 | Screenshot 25 | 26 | 27 | 28 | Screen-capture 29 | 30 | 31 | 32 | pointing 33 | keyboard 34 | touch 35 | 36 | 37 | 38 | https://github.com/esrille/furiganapad/releases/tag/v0.7.2 39 | 40 | 41 | https://github.com/esrille/furiganapad/releases/tag/v0.7.1 42 | 43 | 44 | https://github.com/esrille/furiganapad/releases/tag/v0.7.0 45 | 46 | 47 |
48 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thank you for your interest in contributing to one or more projects managed by Esrille Inc. ("Esrille"). Please carefully read the following guidelines before submitting your Contribution(s), including but not limited to issues, comments, commits, or code: 4 | 5 | * Before creating a pull request, please always open an issue first. New features and other significant changes need to go through a discussion process. 6 | * By submitting your Contribution(s), you declare that you have read, understood and accepted the Terms of [Developer Certificate of Origin](https://developercertificate.org/), which you can also find below. 7 | * Unless otherwise explicitly stated, this project uses the GNU Lesser General Public License. See COPYING for more details. 8 | 9 | For more information, please contact at info@esrille.com. 10 | 11 | ``` 12 | Developer's Certificate of Origin 1.1 13 | 14 | By making a contribution to this project, I certify that: 15 | 16 | (a) The contribution was created in whole or in part by me and I 17 | have the right to submit it under the open source license 18 | indicated in the file; or 19 | 20 | (b) The contribution is based upon previous work that, to the best 21 | of my knowledge, is covered under an appropriate open source 22 | license and I have the right under that license to submit that 23 | work with modifications, whether created in whole or in part 24 | by me, under the same open source license (unless I am 25 | permitted to submit under a different license), as indicated 26 | in the file; or 27 | 28 | (c) The contribution was provided directly to me by some other 29 | person who certified (a), (b) or (c) and I have not modified 30 | it. 31 | 32 | (d) I understand and agree that this project and the contribution 33 | are public and that a record of the contribution (including all 34 | personal information I submit with it, including my sign-off) is 35 | maintained indefinitely and may be redistributed consistent with 36 | this project or the open source license(s) involved. 37 | ``` 38 | -------------------------------------------------------------------------------- /src/furiganapad.css: -------------------------------------------------------------------------------- 1 | @binding-set FuriganaViewBindings { 2 | bind "BackSpace" { "backspace" () }; 3 | bind "Delete" { "delete-from-cursor" (chars, 1) }; 4 | bind "Left" { "move-cursor" (logical-positions, -1, 0) }; 5 | bind "Right" { "move-cursor" (logical-positions, 1, 0) }; 6 | bind "Up" { "move-cursor" (display-lines, -1, 0) }; 7 | bind "Down" { "move-cursor" (display-lines, 1, 0) }; 8 | bind "Page_Up" { "move-cursor" (pages, -1, 0) }; 9 | bind "Page_Down" { "move-cursor" (pages, 1, 0) }; 10 | bind "Home" { "move-cursor" (paragraph-ends, -1, 0) }; 11 | bind "End" { "move-cursor" (paragraph-ends, 1, 0) }; 12 | bind "Home" { "move-cursor" (buffer-ends, -1, 0) }; 13 | bind "End" { "move-cursor" (buffer-ends, 1, 0) }; 14 | bind "Left" { "move-cursor" (words, -1, 0) }; 15 | bind "Right" { "move-cursor" (words, 1, 0) }; 16 | 17 | bind "Left" { "move-cursor" (logical-positions, -1, 1) }; 18 | bind "Right" { "move-cursor" (logical-positions, 1, 1) }; 19 | bind "Up" { "move-cursor" (display-lines, -1, 1) }; 20 | bind "Down" { "move-cursor" (display-lines, 1, 1) }; 21 | bind "Page_Up" { "move-cursor" (pages, -1, 1) }; 22 | bind "Page_Down" { "move-cursor" (pages, 1, 1) }; 23 | bind "Home" { "move-cursor" (paragraph-ends, -1, 1) }; 24 | bind "End" { "move-cursor" (paragraph-ends, 1, 1) }; 25 | bind "Home" { "move-cursor" (buffer-ends, -1, 1) }; 26 | bind "End" { "move-cursor" (buffer-ends, 1, 1) }; 27 | bind "Left" { "move-cursor" (words, -1, 1) }; 28 | bind "Right" { "move-cursor" (words, 1, 1) }; 29 | 30 | bind "A" { "select-all" (1) }; 31 | bind "backslash" { "select-all" (0) }; 32 | bind "Z" { "undo" () }; 33 | bind "X" { "cut-clipboard" () }; 34 | bind "C" { "copy-clipboard" () }; 35 | bind "V" { "paste-clipboard" () }; 36 | 37 | bind "Z" { "redo" () }; 38 | } 39 | FuriganaView { 40 | -gtk-key-bindings: FuriganaViewBindings; 41 | padding-left: 8px; 42 | padding-right: 8px; 43 | } 44 | -------------------------------------------------------------------------------- /docs/install.md: -------------------------------------------------------------------------------- 1 | # インストール方法ほうほう 2 | 3 |  つかっているOSがFedoraかUbuntuであれば、かんたんに「ふりがなパッド」をインストールすることができます。 4 | また、Linuxのアプリストア「[Flathub](https://flathub.org/ja)」から「ふりがなパッド」をインストールすることもできます。 5 | 6 | ### Fedoraのばあい 7 | 8 |  Fedora用ようのソフトウェア パッケージはCoprプロジェクト「[@esrille/releases](https://copr.fedorainfracloud.org/coprs/g/esrille/releases/)」から提供ていきょうしています。 9 | このCoprプロジェクトを有効ゆうこうにするには、いちど、コマンドラインからつぎのように実行じっこうします。 10 | 11 | ``` 12 | sudo dnf copr enable @esrille/releases 13 | ``` 14 | 15 |  あとは、dnfコマンドで「ふりがなパッド」をインストールできます。 16 | 17 | ``` 18 | sudo dnf install furiganapad 19 | ``` 20 | 21 | ### Ubuntuのばあい 22 | 23 |  Ubuntu用ようのソフトウェア パッケージはPPAレポジトリ「[esrille/releases](https://launchpad.net/~esrille/+archive/ubuntu/releases)」から提供ていきょうしています。 24 | このPPAレポジトリを有効ゆうこうにするには、いちど、コマンドラインからつぎのように実行じっこうします。 25 | 26 | ``` 27 | sudo add-apt-repository ppa:esrille/releases 28 | ``` 29 | 30 |  あとは、aptコマンドで「ふりがなパッド」をインストールできます。 31 | 32 | ``` 33 | sudo apt update 34 | sudo apt install furiganapad 35 | ``` 36 | 37 | ### Flathubからインストールする方法ほうほう 38 | 39 |  Flathubからインストールするときは、[GNOME Software](https://apps.gnome.org/Software/)を利用りようするのがかんたんです。 40 | GNOME Softwareが起動きどうしたら、ルーペのアイコンをクリックして、「ふりがなパッド」をさがします。 41 | 英語えいご環境かんきょうのときは、「furiganapad」と入力にゅうりょくしてさがしてください。 42 | 一覧いちらんから「ふりがなパッド」を選択せんたくすると、インストールすることができます。 43 | 44 | ![GNOME Software](furiganapad.flathub.png) 45 | 46 |  Flathubからインストールしたソフトウェアは、それぞれ専用せんようのサンドボックスのなかで実行じっこうされます。 47 | サンドボックスは、インストールしたソフトウェアが不正ふせいなことをおこなえないようにします。 48 | ふりがなパッドのばあいは、ユーザーが指定していしたファイル以外いがいにはアクセスできなくなります。 49 | そのため、以前いぜんひらいていたファイルを自動じどうでひらく機能きのうなどは一部いちぶ、制限せいげんされます。 50 | 51 |
52 | **ヒント**: UbuntuでFlathubを利用りようしたいときは、いちどコマンドラインからつぎのように実行じっこうしてください。 53 | Fedoraでは、GNOME Softwareがはじめからインストールされています。 54 | 55 | ``` 56 | sudo apt install flatpak gnome-software-plugin-flatpak 57 | flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo 58 | ``` 59 | 60 | ### ソースコードからインストールする方法ほうほう 61 | 62 |  「ふりがなパッド」をソースコードからインストールしたいときは、つぎの手順てじゅんでインストールできます。 63 | 64 | ``` 65 | git clone https://github.com/esrille/furiganapad.git 66 | cd furiganapad/ 67 | meson setup --prefix /usr _build 68 | ninja -C _build 69 | sudo ninja -C _build install 70 | ``` 71 | 72 |  ビルドするときに必要ひつようなパッケージについては、debian/controlのBuild-Depends、あるいは、ibus-hiragana.specのBuildRequiresを参考さんこうにしてください。 73 |  Fedoraであれば、つぎのコマンドでビルドに必要ひつようなパッケージをインストールできます。 74 | 75 | ``` 76 | sudo yum-builddep ibus-hiragana.spec 77 | ``` 78 | 79 |  Ubuntuであれば、つぎのコマンドでビルドに必要ひつようなパッケージをインストールできます。 80 | ``` 81 | sudo apt build-dep . 82 | ``` 83 | 84 |  ソースコードからビルドした「ふりがなパッド」をアンインストールするには、つぎのようにします。 85 | 86 | ``` 87 | sudo ninja -C _build uninstall 88 | ``` 89 | -------------------------------------------------------------------------------- /docs/specification.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ファイルの仕様と応用 ― ふりがなパッド 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 25 | 26 | 27 | 43 |
44 |

ファイルの仕様(しよう)応用(おうよう)

45 |

ファイルの仕様(しよう)

46 |

 「ふりがなパッド」は、UTF-8でエンコードされたテキストファイルのよみかきができます。

47 |

 ふりがなは、ユニコードのルビ(よう)のコードポイントU+FFF9からU+FFFBをつかって保存(ほぞん)しています。

48 |

応用(おうよう)

49 |

 ユニコードのルビをHTMLのrubyタグに変換(へんかん)したりするのはかんたんです。つぎの(れい)では、「ふりがなパッド」でかいたREADME.txtを、スクリプトをつかって、README.mdに変換(へんかん)しています。

50 |
$ tools/convert_to_tag.py README.txt README.md
51 | 
52 |

convert_to_tag.pyスクリプトも「ふりがなパッド」のレポジトリのなかにおいてあります。

53 |
54 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /furiganapad.spec.in: -------------------------------------------------------------------------------- 1 | Name: furiganapad 2 | Version: ${version} 3 | Release: %autorelease 4 | Summary: A text editor for Japanese texts with ruby characters 5 | License: LGPL-2.1-or-later 6 | URL: https://github.com/esrille/%{name} 7 | Source0: https://github.com/esrille/%{name}/releases/download/v${source_version}/%{name}-${source_version}.tar.xz 8 | Requires: ibus-hiragana >= 0.14.2 9 | Requires: google-noto-cjk-fonts-common, google-noto-fonts-common 10 | Requires: gtk3 11 | Requires: pango >= 1.44.0 12 | Requires: python3 13 | Requires: python3-cairo 14 | Requires: python3-gobject 15 | Requires: python3-pyicu 16 | Requires: yelp 17 | BuildRequires: desktop-file-utils 18 | BuildRequires: gtk-update-icon-cache 19 | BuildRequires: gettext-devel 20 | BuildRequires: glib2-devel 21 | BuildRequires: libtool 22 | BuildRequires: meson >= 0.53.0 23 | BuildRequires: pkgconfig 24 | BuildRequires: python3-devel 25 | BuildArch: noarch 26 | 27 | %description 28 | FuriganaPad can be used to edit Japanese texts with ruby characters. 29 | Ruby characters are automatically placed above Kanji characters when 30 | converting Hiragana characters into Kanji characters by using 31 | Hiragana IME for IBus. 32 | 33 | %global __python %{__python3} 34 | 35 | %prep 36 | %autosetup 37 | 38 | %build 39 | %meson 40 | %meson_build 41 | 42 | %install 43 | %meson_install 44 | %find_lang %{name} --with-gnome 45 | 46 | %files -f %{name}.lang 47 | %defattr(-,root,root,-) 48 | %doc README.md CONTRIBUTING.md 49 | %license COPYING NOTICE 50 | %{_bindir}/%{name} 51 | %{_datadir}/%{name} 52 | %{_datadir}/applications 53 | %{_datadir}/icons/hicolor/*/*/*.png 54 | %{_datadir}/locale/*/LC_MESSAGES/furiganapad.school.mo 55 | %{_datadir}/metainfo/com.esrille.furiganapad.metainfo.xml 56 | %{_mandir}/man1/furiganapad.1* 57 | %{_mandir}/ja/man1/furiganapad.1* 58 | 59 | %changelog 60 | * ${date} Esrille Inc. - ${version}-1 61 | - See https://github.com/esrille/furiganapad/releases/tag/v${source_version} 62 | 63 | * Thu May 23 2024 Esrille Inc. - 0.7.1-1 64 | - See https://github.com/esrille/furiganapad/releases/tag/v0.7.1 65 | 66 | * Fri May 17 2024 Esrille Inc. - 0.7.0-1 67 | - See https://github.com/esrille/furiganapad/releases/tag/v0.7.0 68 | 69 | * Thu Mar 28 2024 Esrille Inc. - 0.6.2-1 70 | - See https://github.com/esrille/furiganapad/releases/tag/v0.6.2 71 | 72 | * Thu Oct 12 2023 Esrille Inc. - 0.6.1-1 73 | - See https://github.com/esrille/furiganapad/releases/tag/v0.6.1 74 | 75 | * Sun Jun 25 2023 Esrille Inc. - 0.6.0-1 76 | - See https://github.com/esrille/furiganapad/releases/tag/v0.6.0 77 | 78 | * Tue Nov 22 2022 Esrille Inc. - 0.5.5-1 79 | - See https://github.com/esrille/furiganapad/releases/tag/v0.5.5 80 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | はじめに ― ふりがなパッド 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 25 | 26 | 27 | 43 |
44 |

はじめに

45 |

 「ふりがなパッド」は、ふりがなをうった文章(ぶんしょう)をかんたんにつくれるテキスト エディターです。「ひらがなIME」といっしょにつかうと、入力(にゅうりょく)した漢字(かんじ)自動的(じどうてき)にふりがなをふっていきます。

46 | 50 | 51 |

ふりがなについて

52 |

 こども(よう)(ほん)には、すべての漢字(かんじ)にふりがなをふってある(ほん)もすくなくありません。そうしたふりがなのつけかたを「(そう)ふりがな」とか「(そう)ルビ」といいます。

53 |

 さいきんは、おとなも「やさしい日本語(にほんご)」でかいた文章(ぶんしょう)をみたり、かいたりする機会(きかい)がふえてきました。「やさしい日本語(にほんご)」の文章(ぶんしょう)漢字(かんじ)にふりがながふってあります。

54 |

 いまはウェブブラウザも、ふりがなをふつうに表示(ひょうじ)できるようになっています。「ふりがなパッド」は、(そう)ルビの文章(ぶんしょう)をかんたんに作成(さくせい)したり編集(へんしゅう)したりできるようにつくられています。

55 |
56 |


Copyright 2019-2024 Esrille Inc.

57 |
58 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /docs/hiragana_ime.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ひらがなIMEとの連動 ― ふりがなパッド 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 25 | 26 | 27 | 43 |
44 |

ひらがなIMEとの連動(れんどう)

45 |

 「ふりがなパッド」は、「ひらがなIME」の漢字(かんじ)辞書(じしょ)設定(せってい)(おう)じて、メニューの表示(ひょうじ)をきりかえます。

46 |

 漢字(かんじ)辞書(じしょ)小学校(しょうがっこう)年生(ねんせい)から6年生(ねんせい)(よう)であれば、小学生(しょうがくせい)むけのメニューを表示(ひょうじ)します。

47 |

<ruby>小学生<rp>(</rp><rt>しょうがくせい</rt><rp>)</rp></ruby>むけメニュー

48 |

 中学生(ちゅうがくせい)(よう)以上(いじょう)漢字(かんじ)辞書(じしょ)設定(せってい)されていれば、通常(つうじょう)のメニューを表示(ひょうじ)します。

49 |

<ruby>標準<rp>(</rp><rt>ひょうじゅん</rt><rp>)</rp></ruby>メニュー

50 |

 どちらのメニュー表示(ひょうじ)になっていても、つかえる機能(きのう)はおなじです。

51 |
52 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /debian/changelog.in: -------------------------------------------------------------------------------- 1 | furiganapad (${version}) unstable; urgency=low 2 | 3 | * See https://github.com/esrille/furiganapad/releases/tag/v${source_version} 4 | 5 | -- Esrille Inc. ${date} 6 | 7 | furiganapad (0.7.1) unstable; urgency=low 8 | 9 | * See https://github.com/esrille/furiganapad/releases/tag/v0.7.1 10 | 11 | -- Esrille Inc. Thu, 23 May 2024 05:07:34 +0900 12 | 13 | furiganapad (0.7.0) unstable; urgency=low 14 | 15 | * See https://github.com/esrille/furiganapad/releases/tag/v0.7.0 16 | 17 | -- Esrille Inc. Fri, 17 May 2024 22:20:50 +0900 18 | 19 | furiganapad (0.6.2) unstable; urgency=low 20 | 21 | * See https://github.com/esrille/furiganapad/releases/tag/v0.6.2 22 | 23 | -- Esrille Inc. Thu, 28 Mar 2024 16:43:31 +0900 24 | 25 | furiganapad (0.6.1) unstable; urgency=low 26 | 27 | * See https://github.com/esrille/furiganapad/releases/tag/v0.6.1 28 | 29 | -- Esrille Inc. Thu, 12 Oct 2023 00:09:47 +0900 30 | 31 | furiganapad (0.6.0) unstable; urgency=low 32 | 33 | * See https://github.com/esrille/furiganapad/releases/tag/v0.6.0 34 | 35 | -- Esrille Inc. Sun, 25 Jun 2023 12:59:04 +0900 36 | 37 | furiganapad (0.5.5) unstable; urgency=low 38 | 39 | * See https://github.com/esrille/furiganapad/releases/tag/v0.5.5 40 | 41 | -- Esrille Inc. Tue, 22 Nov 2022 23:40:31 +0900 42 | 43 | furiganapad (0.5.4) unstable; urgency=low 44 | 45 | * See https://github.com/esrille/furiganapad/releases/tag/v0.5.4 46 | 47 | -- Esrille Inc. Mon, 18 Jul 2022 14:25:31 +0900 48 | 49 | furiganapad (0.5.3) unstable; urgency=low 50 | 51 | * See https://github.com/esrille/furiganapad/releases/tag/v0.5.3 52 | 53 | -- Esrille Inc. Tue, 14 Jun 2022 16:44:56 +0900 54 | 55 | furiganapad (0.5.2) unstable; urgency=low 56 | 57 | * See https://github.com/esrille/furiganapad/releases/tag/v0.5.2 58 | 59 | -- Esrille Inc. Fri, 10 Jun 2022 09:53:21 +0900 60 | 61 | furiganapad (0.5.1) unstable; urgency=low 62 | 63 | * See https://github.com/esrille/furiganapad/releases/tag/v0.5.1 64 | 65 | -- Esrille Inc. Fri, 08 Oct 2021 11:56:00 +0900 66 | 67 | furiganapad (0.5.0) unstable; urgency=low 68 | 69 | * See https://github.com/esrille/furiganapad/releases/tag/v0.5.0 70 | 71 | -- Esrille Inc. Thu, 10 Jun 2021 03:49:30 +0900 72 | 73 | furiganapad (0.4.2) unstable; urgency=low 74 | 75 | * See https://github.com/esrille/furiganapad/releases/tag/v0.4.2 76 | 77 | -- Esrille Inc. Mon, 26 Apr 2021 13:47:59 +0900 78 | 79 | furiganapad (0.4.1) unstable; urgency=low 80 | 81 | * See https://github.com/esrille/furiganapad/releases/tag/v0.4.1 82 | 83 | -- Esrille Inc. Sat, 23 Jan 2021 03:02:40 +0900 84 | 85 | furiganapad (0.4.0) unstable; urgency=low 86 | 87 | * See https://github.com/esrille/furiganapad/releases/tag/v0.4.0 88 | 89 | -- Esrille Inc. Fri, 18 Dec 2020 19:26:35 +0900 90 | 91 | furiganapad (0.3.0) unstable; urgency=low 92 | 93 | * See https://github.com/esrille/furiganapad/releases/tag/v0.3.0 94 | 95 | -- Esrille Inc. Sat, 26 Sep 2020 11:54:00 +0900 96 | 97 | furiganapad (0.2.0) unstable; urgency=low 98 | 99 | * See https://github.com/esrille/furiganapad/releases/tag/v0.2.0 100 | 101 | -- Esrille Inc. Mon, 15 Jun 2020 11:13:57 +0900 102 | 103 | furiganapad (0.1.0) unstable; urgency=low 104 | 105 | * See https://github.com/esrille/furiganapad/releases/tag/v0.1.0 106 | 107 | -- Esrille Inc. Wed, 22 May 2019 15:14:40 +0900 108 | -------------------------------------------------------------------------------- /docs/usage.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | # つかいかた 8 | 9 | ## 起動きどうのしかた 10 | 11 |  アプリケーションの一覧いちらんから[ふりがなパッド]のアイコンを選択せんたくします。 12 | 13 | ![ペイントのアイコン](icon.png) 14 | 15 |  プログラムのファイル名は"furiganapad"です。 16 |  「ふりがなパッド」が起動きどうすると、したのようなウィンドウがひらきます。 17 | 18 | ![起動きどう画面がめんメニュー](normal.png) 19 | 20 |  このウィンドウのなかで、すぐに文章ぶんしょうをかくことができます。 21 | 文字もじはカーソル(|)の位置いちに挿入そうにゅうされます。 22 | 23 |  「ふりがなパッド」をコマンド ラインから起動きどうしたいときは、つぎのようにタイプします。 24 | ``` 25 | $ furiganapad [ファイル名...] 26 | ``` 27 |  ファイル名めいの部分ぶぶんには、ひらきたいファイルのなまえをタイプします。あたらしいファイルをつくるときは、ファイル名めいを指定していしなくてもかまいません。 28 | 29 | ## 基本的きほんてきなキー操作そうさ 30 | 31 | キー | 内容ないよう 32 | ---|--- 33 | カーソルキー
[←], [↑], [↓], [→] |  カーソルをうごかします。
 [Shiftシフト]キーをおさえながらカーソルキーをおすと、テキストを選択せんたくできます。
 [Ctrlコントロール]キーをおさえながらカーソルキーをおすと、単語たんご単位たんいでカーソルがうごきます。 34 | [Backspaceバックスペース] |  選択せんたくしているテキストがあるときは、その部分ぶぶんを削除さくじょします。そうでなければ、カーソルの直前ちょくぜんの文字もじを削除さくじょします。 35 | [Enterエンター] |  あたらしい段落だんらくをつくります。 36 | [Homeホーム] |  カーソルを段落だんらくのはじめに移動いどうします。
 [Ctrlコントロール]キーをおさえながら[Homeホーム]キーをおすと、カーソルが文頭ぶんとうに移動いどうします。 37 | [Endエンド] |  カーソルを段落だんらくのおわりに移動いどうします。
 [Ctrlコントロール]キーをおさえながら[Endエンド]キーをおすと、カーソルが文末ぶんまつに移動いどうします。 38 | [Pageページ Upアップ] |  画面がめんを上うえにスクロールします。 39 | [Pageページ Downダウン] |  画面がめんを下したにスクロールします。 40 | 41 | ## 文章ぶんしょうの保存ほぞんのしかた 42 | 43 |  かいた文章ぶんしょうは、ファイルに保存ほぞんしておかないと、なくなってしまいます。文章ぶんしょうを保存ほぞんするときは、まず、[ファイル]メニューをクリックします。 44 | そうすると、プルダウン メニューがひらきます。 45 | そのなかから[保存ほぞん]をクリックすると、文章ぶんしょうを保存ほぞんできます。 46 |  おもなメニュー項目こうもくはキーボード ショートカットをつかって実行じっこうすることもできます。 47 | たとえば、[保存ほぞん]は、[Ctrlコントロール]キーをおさえながら、[S]をおすと実行じっこうできます。Sは英語えいごの"Saveセーブ"の頭かしら文字もじからきています。 48 | キーボード ショートカットはプルダウン メニューのなかにかかれています。 49 | 50 | ## ファイル メニュー 51 | 52 | メニュー項目こうもく | 内容ないよう 53 | ---|--- 54 | 新あたらしいウィンドウ
[Ctrl]+[N] |  あたらしい文章ぶんしょうをかくためのウィンドウをひらきます。 55 | 開ひらく...
[Ctrl]+[O] |  ファイルをひらきます。 56 | 保存ほぞん
[Ctrl]+[S] |  文章ぶんしょうを保存ほぞんします。あたらしい文章ぶんしょうを保存ほぞんするときは、ファイル名めいを指定していしてから保存ほぞんします。 57 | 名前なまえをつけて保存ほぞん... |  文章ぶんしょうをべつのファイルに保存ほぞんします。 58 | 閉とじる
[Ctrl]+[W] |  ファイルをとじます。文章ぶんしょうを変更へんこうしていたときは、ファイルを保存ほぞんしなくてもだいじょうぶか確認かくにんをもとめられます。 59 | 終了しゅうりょう
[Ctrl]+[Q] |  ファイルをすべてとじます。変更へんこうされている文章ぶんしょうがあれば、それぞれ保存ほぞんしなくてもだいじょうぶか確認かくにんをもとめられます。 60 | 61 | ## 編集へんしゅうメニュー 62 | 63 |  編集へんしゅうメニューをつかうと、選択せんたくした部分ぶぶんをきりとったり、ルビをふりなおしたりすることができます。 64 |  編集へんしゅうメニューのキーボード ショートカットは、ほんどのアプリケーション ソフトウェアがおなじキーボード ショートカットをつかっています。 65 | よくつかう命令めいれいのキーボード ショートカットはおぼえておくとべんりです。 66 | 67 | メニュー項目こうもく | 内容ないよう 68 | ---|--- 69 | 元もとに戻もどす
[Ctrl]+[Z] |  まちがえた操作そうさをとりけして、もとにもどします。 70 | やり直なおす
[Ctrl]+[Shift]+[Z] |  いちどとりけした操作そうさをやりなおします。 71 | 切きり取とり
[Ctrl]+[X] |  選択せんたくしたテキストをきりとって、クリップボードにいれます。 72 | コピー
[Ctrl]+[C] |  選択せんたくしたテキストをコピーして、クリップボードにいれます。 73 | 貼はり付つけ
[Ctrl]+[V] |  クリップボードにいれたテキストを本文ほんぶんにはりつけます。 74 | すべて選択せんたく
[Ctrl]+[A] |  文章ぶんしょう全体ぜんたいを選択せんたくします。 75 | 検索けんさく...
[Ctrl]+[F] |  ウィンドウのしたがわにテキストボックスが表示ひょうじされます。テキストボックスに字句じくを入力にゅうりょくして、[Enterエンター]キーをおすと、文章ぶんしょうのなかからその字句じくをさがします。
 [Escエスケープ]キーをおすと、テキストボックスをとじられます。 76 | 置換ちかん...
[Ctrl]+[H] |  ウィンドウのしたがわに、ふたつテキストボックスが表示ひょうじされます。うえのテキストボックスには、さがしたい字句じくを入力にゅうりょくします。したのテキストボックスには、おきかえる字句じくを入力にゅうりょくします。[Enterエンター]キーをおすと、さがしたい字句じくがあれば、その字句じくが選択せんたくされます。そこで、もういちど[Enterエンター]キーをおすと、字句じくをおきかえられます。
 [Escエスケープ]キーをおすと、テキストボックスをとじられます。 77 | ルビをふる...
[Ctrl]+[B] |  まずルビをふりたい字句じくを選択せんたくしておきます。このコマンドを実行じっこうすると、ウィンドウのしたがわにテキストボックスが表示ひょうじされます。ルビを入力にゅうりょくして、[Enterエンター]キーをおすと、選択せんたくしたテキストにルビがふられます。
 [Escエスケープ]キーをおすと、テキストボックスをとじられます。 78 | ひらがなに戻もどす
[Ctrl]+[T] |  まずルビがふられている字句じくのすぐあとにカーソルを移動いどうしておきます。このコマンドを実行じっこうすると、ルビのふられている漢字かんじをひらがなにもどせます。 79 | 80 | ## 設定せっていメニュー 81 | 82 | メニュー項目こうもく | 内容ないよう 83 | ---|--- 84 | フォントを変かえる |  文章ぶんしょうの表示ひょうじにつかうフォントをえらびます。 85 | ルビをふる
[Ctrl]+[R] |  チェックをつけておくと、変換へんかんした漢字かんじに自動的じどうてきにルビがふられます。
※ 「ひらがなIME」を使用しようしているときにだけ有効ゆうこうな機能きのうです。 86 | 長ながい文ぶんをめだたせる |  チェックをつけておくと、ながい文ぶんを色いろづけして表示ひょうじします。一文ぶんのながさが50字じをこえると、文ぶんの背景はいけいが黄き色いろになります。さらに、60字じをこえると、文ぶんの背景はいけいが赤色 あかいろになります。
 ながい文ぶんはみじかくきって、かきなおすと、よみやすくなります。背景はいけいが赤色 あかいろになっている文ぶんは、ふたつの文ぶんにわけたりできないか、かんがえてみてください。 87 | ステータスバー |  チェックをつけておくと、ウィンドウのしたの部分ぶぶんにステータスバーを表示ひょうじします。 88 | 89 | ## ヘルプ メニュー 90 | 91 | メニュー項目こうもく | 内容ないよう 92 | ---|--- 93 | ヘルプ
[F1] |  ウェブブラウザーで「ふりがなパッド」の手てびきのページを表示ひょうじします。 94 | ふりがなパッドについて |  「ふりがなパッド」のバージョン情報じょうほうなどを表示ひょうじします。 95 | 96 | -------------------------------------------------------------------------------- /docs/md2html.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # 3 | # Copyright (c) 2017-2020 Esrille Inc. 4 | # 5 | # This library is free software; you can redistribute it and/or 6 | # modify it under the terms of the GNU Lesser General Public 7 | # License as published by the Free Software Foundation; either 8 | # version 2.1 of the License, or (at your option) any later version. 9 | # 10 | # This library is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public 16 | # License along with this library; if not, see . 17 | 18 | import html 19 | import markdown 20 | import re 21 | import sys 22 | import textwrap 23 | 24 | from markdown.preprocessors import Preprocessor 25 | from markdown.extensions import Extension 26 | 27 | 28 | IAA = '\uFFF9' # IAA (INTERLINEAR ANNOTATION ANCHOR) 29 | IAS = '\uFFFA' # IAS (INTERLINEAR ANNOTATION SEPARATOR) 30 | IAT = '\uFFFB' # IAT (INTERLINEAR ANNOTATION TERMINATOR) 31 | 32 | title = '' 33 | 34 | 35 | class MyPreprocessor(Preprocessor): 36 | 37 | def strip_ruby(self, line): 38 | br = line.find('
') 39 | if 0 <= br: 40 | line = line[:br] 41 | iaa = line.find(IAA) 42 | while 0 <= iaa: 43 | line = line[:iaa] + line[iaa + 1:] 44 | ias = line.find(IAS) 45 | iat = line.find(IAT) 46 | line = line[:ias] + line[iat + 1:] 47 | iaa = line.find(IAA) 48 | return line 49 | 50 | def run(self, lines): 51 | global title 52 | tr = str.maketrans({ 53 | IAA: '', 54 | IAS: '(', 55 | IAT: ')' 56 | }) 57 | pre = False 58 | new_lines = [] 59 | for line in lines: 60 | if line: 61 | if line.startswith("# "): 62 | title = line[2:].strip(' \n\r') 63 | title = self.strip_ruby(title) 64 | line = line.translate(tr) 65 | if line.startswith("```"): 66 | pre = pre ^ True 67 | elif not pre: 68 | if line.startswith(' '): 69 | line = '\n' + line 70 | line = line.replace(' ', ' ') 71 | else: 72 | line += '↲' 73 | if not new_lines[-1].startswith("```"): 74 | new_lines[-1] = new_lines[-1] + line 75 | continue 76 | new_lines.append(line) 77 | return new_lines 78 | 79 | 80 | class MyExtension(Extension): 81 | 82 | def extendMarkdown(self, md, md_globals): 83 | # Insert code here to change markdown's behavior. 84 | md.preprocessors.add('my', MyPreprocessor(md), '_begin') 85 | 86 | 87 | def main(): 88 | global title 89 | 90 | if len(sys.argv) < 2: 91 | print('Usage: md2html path/to/file prev next [template]', 92 | file=sys.stderr) 93 | sys.exit(1) 94 | 95 | prev_url = next_url = '' 96 | if 4 <= len(sys.argv): 97 | prev_url = sys.argv[2][:-2] + 'html' 98 | next_url = sys.argv[3][:-2] + 'html' 99 | 100 | path = 'template.html' 101 | if 5 <= len(sys.argv): 102 | path = sys.argv[4] 103 | template = '' 104 | with open(path) as file: 105 | for line in file: 106 | template += line 107 | 108 | path = sys.argv[1] 109 | source = '' 110 | with open(path) as file: 111 | for line in file: 112 | source += line 113 | 114 | md = markdown.Markdown(extensions=[MyExtension(), 115 | 'markdown.extensions.meta', 116 | 'markdown.extensions.sane_lists', 117 | 'markdown.extensions.tables', 118 | 'markdown.extensions.extra', 119 | 'markdown.extensions.attr_list'], 120 | output_format='html5') 121 | 122 | body = md.convert(source) 123 | description = title 124 | og_image = 'https://esrille.github.io/ibus-hiragana/screenshot.png' 125 | if 'summary' in md.Meta: 126 | description = ' '.join(md.Meta['summary']) 127 | if 'language' in md.Meta: 128 | template = template.replace( 129 | "", 130 | "", 131 | 1) 132 | if 'og_image' in md.Meta: 133 | og_image = md.Meta['og_image'][0] 134 | 135 | path = path[:-2] + 'html' 136 | content = textwrap.dedent( 137 | template.format(body=body, 138 | title=html.escape(title), 139 | prev_url=prev_url, 140 | next_url=next_url, 141 | description=html.escape(description), 142 | og_image=html.escape(og_image), 143 | path=path)) 144 | 145 | content = content.replace("。\n", "。") 146 | content = content.replace("↲", "\n") 147 | content = content.replace("\n", "") 148 | 149 | with open(path, 'w') as file: 150 | file.write(content) 151 | 152 | 153 | if __name__ == '__main__': 154 | main() 155 | -------------------------------------------------------------------------------- /src/breaker.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2021-2024 Esrille Inc. 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, see . 16 | 17 | import logging 18 | 19 | import icu 20 | 21 | 22 | LOGGER = logging.getLogger(__name__) 23 | 24 | IAA = '\uFFF9' # IAA (INTERLINEAR ANNOTATION ANCHOR) 25 | IAS = '\uFFFA' # IAS (INTERLINEAR ANNOTATION SEPARATOR) 26 | IAT = '\uFFFB' # IAT (INTERLINEAR ANNOTATION TERMINATOR) 27 | 28 | PLAIN = 0 29 | BASE = 1 30 | RUBY = 2 31 | 32 | # Note 'を' is intentionally removed from HIRAGANA_BREAK. 33 | HIRAGANA_BREAK = ('あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわん' 34 | 'ゔがぎぐげござじずぜぞだぢづでどばびぶべぼぁぃぅぇぉゃゅょっぱぴぷぺぽゎゐゑゝゞ') 35 | 36 | 37 | def is_hiragana_break(s, offset): 38 | if offset <= 0 or len(s) <= offset: 39 | return False 40 | if s[offset - 1] in HIRAGANA_BREAK and s[offset] in (HIRAGANA_BREAK + 'を'): 41 | return True 42 | return False 43 | 44 | 45 | class Breaker: 46 | 47 | def __init__(self, text=''): 48 | self.length = 0 49 | self.cursor_positions = [] 50 | self.word_starts = [] 51 | self.word_ends = [] 52 | if text: 53 | self.set_text(text) 54 | 55 | def following(self, offset): 56 | assert 0 <= offset <= self.length 57 | while True: 58 | offset += 1 59 | if self.length < offset: 60 | return offset 61 | if self.cursor_positions[offset]: 62 | return offset 63 | 64 | def following_word_end(self, offset): 65 | assert 0 <= offset <= self.length 66 | while True: 67 | offset += 1 68 | if self.length < offset: 69 | return offset 70 | if self.word_ends[offset]: 71 | return offset 72 | 73 | def preceding(self, offset): 74 | assert 0 <= offset <= self.length 75 | while True: 76 | offset -= 1 77 | if offset < 0: 78 | return offset 79 | if self.cursor_positions[offset]: 80 | return offset 81 | 82 | def preceding_word_start(self, offset): 83 | assert 0 <= offset <= self.length 84 | while True: 85 | offset -= 1 86 | if offset < 0: 87 | return offset 88 | if self.word_starts[offset]: 89 | return offset 90 | 91 | def set_text(self, text): 92 | self.length = len(text) 93 | if not text: 94 | self.cursor_positions = [] 95 | self.word_starts = [] 96 | self.word_ends = [] 97 | return 98 | 99 | self.cursor_positions = [0] * (self.length + 1) 100 | self.word_starts = [0] * (self.length + 1) 101 | self.word_ends = [0] * (self.length + 1) 102 | u16str = text.encode('utf_16_le') 103 | 104 | # Calculate cursor_positions 105 | boundary = icu.BreakIterator.createCharacterInstance(icu.Locale.getJapan()) 106 | boundary.setText(text) 107 | u16offset = boundary.first() 108 | offset = len(u16str[:u16offset * 2].decode('utf_16_le', 'ignore')) 109 | self.cursor_positions[offset] = 1 110 | mode = PLAIN 111 | for u16offset in boundary: 112 | c = text[offset] # previous character 113 | offset = len(u16str[:u16offset * 2].decode('utf_16_le', 'ignore')) 114 | d = text[offset] if offset < self.length else '' # next character 115 | if c == IAA: 116 | mode = BASE 117 | elif d == IAS: 118 | mode = RUBY 119 | elif d == IAT: 120 | mode = PLAIN 121 | elif mode != RUBY: 122 | self.cursor_positions[offset] = 1 123 | self.cursor_positions[-1] = 1 124 | 125 | # Calculate word_starts and word_ends 126 | boundary = icu.BreakIterator.createWordInstance(icu.Locale.getJapan()) 127 | boundary.setText(text) 128 | u16offset = boundary.first() 129 | offset = len(u16str[:u16offset * 2].decode('utf_16_le', 'ignore')) 130 | for u16offset in boundary: 131 | if self.cursor_positions[offset]: 132 | if not text[offset].isspace() and not is_hiragana_break(text, offset): 133 | self.word_starts[offset] = 1 134 | elif 0 < offset and text[offset - 1] == IAA: 135 | self.word_starts[offset - 1] = 1 136 | offset = len(u16str[:u16offset * 2].decode('utf_16_le', 'ignore')) 137 | if self.cursor_positions[offset]: 138 | if 0 < offset and not text[offset - 1].isspace() and not is_hiragana_break(text, offset): 139 | self.word_ends[offset] = 1 140 | elif 1 < offset and text[offset - 1] == IAA: 141 | self.word_ends[offset - 1] = 1 142 | self.word_starts[0] = 1 143 | self.word_ends[-1] = 1 144 | -------------------------------------------------------------------------------- /po/ja.po: -------------------------------------------------------------------------------- 1 | # Furiganapad 2 | # Copyright (C) 2020-2024 Esrille Inc. 3 | # This file is distributed under the same license as the furiganapad package. 4 | # Esrille Inc. , 2020-2023. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: furiganapad 0.7.2\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2025-04-13 15:55+0900\n" 11 | "PO-Revision-Date: 2020-06-11 05:38+0900\n" 12 | "Last-Translator: Esrille Inc. \n" 13 | "Language-Team: Japanese \n" 14 | "Language: ja\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #: data/com.esrille.furiganapad.desktop.in:4 20 | #: data/com.esrille.furiganapad.metainfo.xml.in:6 src/window.py:45 21 | msgid "FuriganaPad" 22 | msgstr "ふりがなパッド" 23 | 24 | #: data/com.esrille.furiganapad.desktop.in:5 25 | #: data/com.esrille.furiganapad.metainfo.xml.in:7 26 | msgid "Write Japanese text with Ruby annotations easily" 27 | msgstr "ふりがなつきの文章をかんたんにかけます" 28 | 29 | #: data/com.esrille.furiganapad.metainfo.xml.in:12 30 | msgid "" 31 | "With Hiragana IME for IBus, FuriganaPad automatically puts Ruby characters " 32 | "above Kanji as you type them." 33 | msgstr "" 34 | "「ひらがなIME for IBus」といっしょにつかうと、入力した漢字に自動的にふりがな" 35 | "をつけていきます。" 36 | 37 | #: data/com.esrille.furiganapad.metainfo.xml.in:24 38 | msgid "Screenshot" 39 | msgstr "スクリーンショット" 40 | 41 | #: data/com.esrille.furiganapad.metainfo.xml.in:28 42 | msgid "Screen-capture" 43 | msgstr "スクリーンキャプチャー" 44 | 45 | #: src/application.py:49 46 | msgid "Initial window x position" 47 | msgstr "ウインドウの x 座標" 48 | 49 | #: src/application.py:49 50 | msgid "x" 51 | msgstr "x" 52 | 53 | #: src/application.py:51 54 | msgid "Initial window y position" 55 | msgstr "ウインドウの y 座標" 56 | 57 | #: src/application.py:51 58 | msgid "y" 59 | msgstr "y" 60 | 61 | #: src/application.py:53 62 | msgid "Initial window width" 63 | msgstr "ウインドウの幅" 64 | 65 | #: src/application.py:53 66 | msgid "w" 67 | msgstr "w" 68 | 69 | #: src/application.py:55 70 | msgid "Initial window height" 71 | msgstr "ウインドウの高さ" 72 | 73 | #: src/application.py:55 74 | msgid "h" 75 | msgstr "h" 76 | 77 | #: src/application.py:57 78 | msgid "Print version information" 79 | msgstr "バージョン番号を表示する" 80 | 81 | #: src/window.py:99 src/window.py:530 src/window.py:532 82 | msgid "Ruby" 83 | msgstr "ルビ" 84 | 85 | #: src/window.py:208 86 | msgid "Text files" 87 | msgstr "テキスト ファイル" 88 | 89 | #: src/window.py:213 90 | msgid "Python files" 91 | msgstr "Pythonのファイル" 92 | 93 | #: src/window.py:218 94 | msgid "Any files" 95 | msgstr "すべてのファイル" 96 | 97 | #: src/window.py:236 98 | msgid "Save changes to this document?" 99 | msgstr "書きかえた文章を保存しますか?" 100 | 101 | #: src/window.py:237 102 | msgid "If you don't, changes will be lost." 103 | msgstr "保存しないと、書きかえた文章は残りません。" 104 | 105 | #: src/window.py:238 106 | msgid "Close _Without Saving" 107 | msgstr "保存しないで閉じる(_W)" 108 | 109 | #: src/window.py:271 110 | msgid "Font" 111 | msgstr "フォント" 112 | 113 | #: src/window.py:272 114 | msgid "The quick brown fox jumps over the lazy dog." 115 | msgstr "ひさかたのひかりのどけきはるの日に しづごころなく花のちるらむ" 116 | 117 | #: src/window.py:380 118 | msgid "Open File" 119 | msgstr "ファイルを開く" 120 | 121 | #: src/window.py:382 122 | msgid "Open" 123 | msgstr "開く" 124 | 125 | #: src/window.py:383 src/window.py:458 126 | msgid "Cancel" 127 | msgstr "キャンセル" 128 | 129 | #: src/window.py:445 130 | msgid "Could not save the file." 131 | msgstr "ファイルを保存できませんでした。" 132 | 133 | #: src/window.py:454 134 | msgid "Save File" 135 | msgstr "名前をつけて保存" 136 | 137 | #: src/window.py:457 138 | msgid "Save" 139 | msgstr "保存" 140 | 141 | #: src/furiganapad.menu.ui:6 142 | msgid "_File" 143 | msgstr "ファイル(_F)" 144 | 145 | #: src/furiganapad.menu.ui:9 146 | msgid "_New Window" 147 | msgstr "新しいウィンドウ(_N)" 148 | 149 | #: src/furiganapad.menu.ui:14 150 | msgid "_Open…" 151 | msgstr "開く(_O)…" 152 | 153 | #: src/furiganapad.menu.ui:21 154 | msgid "_Save" 155 | msgstr "保存(_S)" 156 | 157 | #: src/furiganapad.menu.ui:26 158 | msgid "Save _As…" 159 | msgstr "名前をつけて保存(_A)…" 160 | 161 | #: src/furiganapad.menu.ui:32 162 | msgid "_Close" 163 | msgstr "閉じる(_C)" 164 | 165 | #: src/furiganapad.menu.ui:37 166 | msgid "_Quit" 167 | msgstr "終了(_Q)" 168 | 169 | #: src/furiganapad.menu.ui:44 170 | msgid "_Edit" 171 | msgstr "編集(_E)" 172 | 173 | #: src/furiganapad.menu.ui:47 174 | msgid "_Undo" 175 | msgstr "元に戻す(_U)" 176 | 177 | #: src/furiganapad.menu.ui:52 178 | msgid "Re_do" 179 | msgstr "やり直す(_R)" 180 | 181 | #: src/furiganapad.menu.ui:59 182 | msgid "Cu_t" 183 | msgstr "切り取り(_T)" 184 | 185 | #: src/furiganapad.menu.ui:64 186 | msgid "_Copy" 187 | msgstr "コピー(_C)" 188 | 189 | #: src/furiganapad.menu.ui:69 190 | msgid "_Paste" 191 | msgstr "貼り付け(_P)" 192 | 193 | #: src/furiganapad.menu.ui:76 194 | msgid "Select _All" 195 | msgstr "すべて選択(_A)" 196 | 197 | #: src/furiganapad.menu.ui:83 198 | msgid "_Find…" 199 | msgstr "検索(_F)…" 200 | 201 | #: src/furiganapad.menu.ui:88 202 | msgid "_Replace…" 203 | msgstr "置換(_R)…" 204 | 205 | #: src/furiganapad.menu.ui:95 206 | msgid "Ru_by…" 207 | msgstr "ルビをふる(_B)…" 208 | 209 | #: src/furiganapad.menu.ui:100 210 | msgid "Revert to _Hiragana" 211 | msgstr "ひらがなに戻す(_H)" 212 | 213 | #: src/furiganapad.menu.ui:107 214 | msgid "_Settings" 215 | msgstr "設定(_S)" 216 | 217 | #: src/furiganapad.menu.ui:110 218 | msgid "_Font…" 219 | msgstr "フォントを変える(_F)…" 220 | 221 | #: src/furiganapad.menu.ui:114 222 | msgid "_Ruby" 223 | msgstr "ルビをふる(_R)" 224 | 225 | #: src/furiganapad.menu.ui:119 226 | msgid "Highlight _Long Sentences" 227 | msgstr "長い文をめだたせる(_L)" 228 | 229 | #: src/furiganapad.menu.ui:123 230 | msgid "_Statusbar" 231 | msgstr "ステータスバー(_S)" 232 | 233 | #: src/furiganapad.menu.ui:129 src/furiganapad.menu.ui:132 234 | msgid "_Help" 235 | msgstr "ヘルプ(_H)" 236 | 237 | #: src/furiganapad.menu.ui:137 238 | msgid "_About Furiganapad" 239 | msgstr "ふりがなパッドについて(_A)" 240 | -------------------------------------------------------------------------------- /po.school/ja.po: -------------------------------------------------------------------------------- 1 | # Furiganapad 2 | # Copyright (C) 2020-2024 Esrille Inc. 3 | # This file is distributed under the same license as the furiganapad package. 4 | # Esrille Inc. , 2020-2023. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: furiganapad 0.7.2\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2025-04-13 15:55+0900\n" 11 | "PO-Revision-Date: 2020-06-11 05:38+0900\n" 12 | "Last-Translator: Esrille Inc. \n" 13 | "Language-Team: Japanese \n" 14 | "Language: ja\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #: data/com.esrille.furiganapad.desktop.in:4 20 | #: data/com.esrille.furiganapad.metainfo.xml.in:6 src/window.py:45 21 | msgid "FuriganaPad" 22 | msgstr "ふりがなパッド" 23 | 24 | #: data/com.esrille.furiganapad.desktop.in:5 25 | #: data/com.esrille.furiganapad.metainfo.xml.in:7 26 | msgid "Write Japanese text with Ruby annotations easily" 27 | msgstr "ふりがなつきの文章をかんたんにかけます" 28 | 29 | #: data/com.esrille.furiganapad.metainfo.xml.in:12 30 | msgid "" 31 | "With Hiragana IME for IBus, FuriganaPad automatically puts Ruby characters " 32 | "above Kanji as you type them." 33 | msgstr "" 34 | "「ひらがなIME for IBus」といっしょにつかうと、入力した漢字に自動的にふりがな" 35 | "をつけていきます。" 36 | 37 | #: data/com.esrille.furiganapad.metainfo.xml.in:24 38 | msgid "Screenshot" 39 | msgstr "スクリーンショット" 40 | 41 | #: data/com.esrille.furiganapad.metainfo.xml.in:28 42 | msgid "Screen-capture" 43 | msgstr "スクリーンキャプチャー" 44 | 45 | #: src/application.py:49 46 | msgid "Initial window x position" 47 | msgstr "ウインドウの左からのばしょ" 48 | 49 | #: src/application.py:49 50 | msgid "x" 51 | msgstr "x" 52 | 53 | #: src/application.py:51 54 | msgid "Initial window y position" 55 | msgstr "ウインドウの上からのばしょ" 56 | 57 | #: src/application.py:51 58 | msgid "y" 59 | msgstr "y" 60 | 61 | #: src/application.py:53 62 | msgid "Initial window width" 63 | msgstr "ウインドウのはば" 64 | 65 | #: src/application.py:53 66 | msgid "w" 67 | msgstr "w" 68 | 69 | #: src/application.py:55 70 | msgid "Initial window height" 71 | msgstr "ウインドウのたかさ" 72 | 73 | #: src/application.py:55 74 | msgid "h" 75 | msgstr "h" 76 | 77 | #: src/application.py:57 78 | msgid "Print version information" 79 | msgstr "バージョンをみる" 80 | 81 | #: src/window.py:99 src/window.py:530 src/window.py:532 82 | msgid "Ruby" 83 | msgstr "ルビ" 84 | 85 | #: src/window.py:208 86 | msgid "Text files" 87 | msgstr "テキスト ファイル" 88 | 89 | #: src/window.py:213 90 | msgid "Python files" 91 | msgstr "Pythonのファイル" 92 | 93 | #: src/window.py:218 94 | msgid "Any files" 95 | msgstr "すべてのファイル" 96 | 97 | #: src/window.py:236 98 | msgid "Save changes to this document?" 99 | msgstr "かきかえた文章をセーブしますか?" 100 | 101 | #: src/window.py:237 102 | msgid "If you don't, changes will be lost." 103 | msgstr "セーブしないと、かきかえた文章はきえてしまいます。" 104 | 105 | #: src/window.py:238 106 | msgid "Close _Without Saving" 107 | msgstr "セーブしないでとじる(_W)" 108 | 109 | #: src/window.py:271 110 | msgid "Font" 111 | msgstr "フォント" 112 | 113 | #: src/window.py:272 114 | msgid "The quick brown fox jumps over the lazy dog." 115 | msgstr "ひさかたのひかりのどけきはるの日に しづごころなく花のちるらむ" 116 | 117 | #: src/window.py:380 118 | msgid "Open File" 119 | msgstr "ファイルをひらく" 120 | 121 | #: src/window.py:382 122 | msgid "Open" 123 | msgstr "ひらく" 124 | 125 | #: src/window.py:383 src/window.py:458 126 | msgid "Cancel" 127 | msgstr "キャンセル" 128 | 129 | #: src/window.py:445 130 | msgid "Could not save the file." 131 | msgstr "ファイルをセーブできませんでした。" 132 | 133 | #: src/window.py:454 134 | msgid "Save File" 135 | msgstr "なまえをつけてセーブ" 136 | 137 | #: src/window.py:457 138 | msgid "Save" 139 | msgstr "セーブ" 140 | 141 | #: src/furiganapad.menu.ui:6 142 | msgid "_File" 143 | msgstr "ファイル(_F)" 144 | 145 | #: src/furiganapad.menu.ui:9 146 | msgid "_New Window" 147 | msgstr "あたらしいウィンドウ(_N)" 148 | 149 | #: src/furiganapad.menu.ui:14 150 | msgid "_Open…" 151 | msgstr "ひらく(_O)…" 152 | 153 | #: src/furiganapad.menu.ui:21 154 | msgid "_Save" 155 | msgstr "セーブ(_S)" 156 | 157 | #: src/furiganapad.menu.ui:26 158 | msgid "Save _As…" 159 | msgstr "なまえをつけてセーブ(_A)…" 160 | 161 | #: src/furiganapad.menu.ui:32 162 | msgid "_Close" 163 | msgstr "とじる(_C)" 164 | 165 | #: src/furiganapad.menu.ui:37 166 | msgid "_Quit" 167 | msgstr "おえる(_Q)" 168 | 169 | #: src/furiganapad.menu.ui:44 170 | msgid "_Edit" 171 | msgstr "へんしゅう(_E)" 172 | 173 | #: src/furiganapad.menu.ui:47 174 | msgid "_Undo" 175 | msgstr "とりけす(_U)" 176 | 177 | #: src/furiganapad.menu.ui:52 178 | msgid "Re_do" 179 | msgstr "やりなおす(_R)" 180 | 181 | #: src/furiganapad.menu.ui:59 182 | msgid "Cu_t" 183 | msgstr "カット(_T)" 184 | 185 | #: src/furiganapad.menu.ui:64 186 | msgid "_Copy" 187 | msgstr "コピー(_C)" 188 | 189 | #: src/furiganapad.menu.ui:69 190 | msgid "_Paste" 191 | msgstr "ペースト(_P)" 192 | 193 | #: src/furiganapad.menu.ui:76 194 | msgid "Select _All" 195 | msgstr "すべての文をえらぶ(_A)" 196 | 197 | #: src/furiganapad.menu.ui:83 198 | msgid "_Find…" 199 | msgstr "さがす(_F)…" 200 | 201 | #: src/furiganapad.menu.ui:88 202 | msgid "_Replace…" 203 | msgstr "おきかえる(_R)…" 204 | 205 | #: src/furiganapad.menu.ui:95 206 | msgid "Ru_by…" 207 | msgstr "ルビをふる(_B)…" 208 | 209 | #: src/furiganapad.menu.ui:100 210 | msgid "Revert to _Hiragana" 211 | msgstr "ひらがなにもどす(_H)" 212 | 213 | #: src/furiganapad.menu.ui:107 214 | msgid "_Settings" 215 | msgstr "せってい(_S)" 216 | 217 | #: src/furiganapad.menu.ui:110 218 | msgid "_Font…" 219 | msgstr "フォントをかえる(_F)…" 220 | 221 | #: src/furiganapad.menu.ui:114 222 | msgid "_Ruby" 223 | msgstr "ルビをふる(_R)" 224 | 225 | #: src/furiganapad.menu.ui:119 226 | msgid "Highlight _Long Sentences" 227 | msgstr "ながい文をめだたせる(_L)" 228 | 229 | #: src/furiganapad.menu.ui:123 230 | msgid "_Statusbar" 231 | msgstr "ステータスバー(_S)" 232 | 233 | #: src/furiganapad.menu.ui:129 src/furiganapad.menu.ui:132 234 | msgid "_Help" 235 | msgstr "ヘルプ(_H)" 236 | 237 | #: src/furiganapad.menu.ui:137 238 | msgid "_About Furiganapad" 239 | msgstr "ふりがなパッドについて(_A)" 240 | -------------------------------------------------------------------------------- /docs/install.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | インストール方法 ― ふりがなパッド 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 25 | 26 | 27 | 43 |
44 |

インストール方法(ほうほう)

45 |

 つかっているOSがFedoraかUbuntuであれば、かんたんに「ふりがなパッド」をインストールすることができます。また、Linuxのアプリストア「Flathub」から「ふりがなパッド」をインストールすることもできます。

46 |

Fedoraのばあい

47 |

 Fedora(よう)のソフトウェア パッケージはCoprプロジェクト「@esrille/releases」から提供(ていきょう)しています。このCoprプロジェクトを有効(ゆうこう)にするには、いちど、コマンドラインからつぎのように実行(じっこう)します。

48 |
sudo dnf copr enable @esrille/releases
49 | 
50 |

 あとは、dnfコマンドで「ふりがなパッド」をインストールできます。

51 |
sudo dnf install furiganapad
52 | 
53 |

Ubuntuのばあい

54 |

 Ubuntu(よう)のソフトウェア パッケージはPPAレポジトリ「esrille/releases」から提供(ていきょう)しています。このPPAレポジトリを有効(ゆうこう)にするには、いちど、コマンドラインからつぎのように実行(じっこう)します。

55 |
sudo add-apt-repository ppa:esrille/releases
56 | 
57 |

 あとは、aptコマンドで「ふりがなパッド」をインストールできます。

58 |
sudo apt update
59 | sudo apt install furiganapad
60 | 
61 |

Flathubからインストールする方法(ほうほう)

62 |

 Flathubからインストールするときは、GNOME Software利用(りよう)するのがかんたんです。GNOME Softwareが起動(きどう)したら、ルーペのアイコンをクリックして、「ふりがなパッド」をさがします。英語(えいご)環境(かんきょう)のときは、「furiganapad」と入力(にゅうりょく)してさがしてください。一覧(いちらん)から「ふりがなパッド」を選択(せんたく)すると、インストールすることができます。

63 |

GNOME Software

64 |

 Flathubからインストールしたソフトウェアは、それぞれ専用(せんよう)のサンドボックスのなかで実行(じっこう)されます。サンドボックスは、インストールしたソフトウェアが不正(ふせい)なことをおこなえないようにします。ふりがなパッドのばあいは、ユーザーが指定(してい)したファイル以外(いがい)にはアクセスできなくなります。そのため、以前(いぜん)ひらいていたファイルを自動(じどう)でひらく機能(きのう)などは一部(いちぶ)制限(せいげん)されます。

65 |


66 | ヒント: UbuntuでFlathubを利用(りよう)したいときは、いちどコマンドラインからつぎのように実行(じっこう)してください。Fedoraでは、GNOME Softwareがはじめからインストールされています。

67 |
sudo apt install flatpak gnome-software-plugin-flatpak
68 | flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
69 | 
70 |

ソースコードからインストールする方法(ほうほう)

71 |

 「ふりがなパッド」をソースコードからインストールしたいときは、つぎの手順(てじゅん)でインストールできます。

72 |
git clone https://github.com/esrille/furiganapad.git
73 | cd furiganapad/
74 | meson setup --prefix /usr _build
75 | ninja -C _build
76 | sudo ninja -C _build install
77 | 
78 |

 ビルドするときに必要(ひつよう)なパッケージについては、debian/controlのBuild-Depends、あるいは、ibus-hiragana.specのBuildRequiresを参考(さんこう)にしてください。

79 |

 Fedoraであれば、つぎのコマンドでビルドに必要(ひつよう)なパッケージをインストールできます。

80 |
sudo yum-builddep ibus-hiragana.spec
81 | 
82 |

 Ubuntuであれば、つぎのコマンドでビルドに必要(ひつよう)なパッケージをインストールできます。

83 |
sudo apt build-dep .
84 | 
85 |

 ソースコードからビルドした「ふりがなパッド」をアンインストールするには、つぎのようにします。

86 |
sudo ninja -C _build uninstall
87 | 
88 |
89 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /src/furiganapad.menu.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | _File 7 |
8 | 9 | _New Window 10 | win.new 11 | <Primary>n 12 | 13 | 14 | _Open… 15 | win.open 16 | <Primary>o 17 | 18 |
19 |
20 | 21 | _Save 22 | win.save 23 | <Primary>s 24 | 25 | 26 | Save _As… 27 | win.saveas 28 | 29 |
30 |
31 | 32 | _Close 33 | win.close 34 | <Primary>w 35 | 36 | 37 | _Quit 38 | app.quit 39 | <Primary>q 40 | 41 |
42 |
43 | 44 | _Edit 45 |
46 | 47 | _Undo 48 | win.undo 49 | <Primary>z 50 | 51 | 52 | Re_do 53 | win.redo 54 | <Primary><Shift>z 55 | 56 |
57 |
58 | 59 | Cu_t 60 | win.cut 61 | <Primary>x 62 | 63 | 64 | _Copy 65 | win.copy 66 | <Primary>c 67 | 68 | 69 | _Paste 70 | win.paste 71 | <Primary>v 72 | 73 |
74 |
75 | 76 | Select _All 77 | win.selectall 78 | <Primary>a 79 | 80 |
81 |
82 | 83 | _Find… 84 | win.find 85 | <Primary>f 86 | 87 | 88 | _Replace… 89 | win.replace 90 | <Primary>h 91 | 92 |
93 |
94 | 95 | Ru_by… 96 | win.annotate 97 | <Primary>b 98 | 99 | 100 | Revert to _Hiragana 101 | win.unconvert 102 | <Primary>t 103 | 104 |
105 |
106 | 107 | _Settings 108 |
109 | 110 | _Font… 111 | win.font 112 | 113 | 114 | _Ruby 115 | win.ruby 116 | <Primary>r 117 | 118 | 119 | Highlight _Long Sentences 120 | win.highlightlongsentences 121 | 122 | 123 | _Statusbar 124 | win.statusbar 125 | 126 |
127 |
128 | 129 | _Help 130 |
131 | 132 | _Help 133 | win.help 134 | F1 135 | 136 | 137 | _About Furiganapad 138 | win.about 139 | 140 |
141 |
142 |
143 |
144 | -------------------------------------------------------------------------------- /po/it.po: -------------------------------------------------------------------------------- 1 | # Furiganapad 2 | # Copyright (C) 2020-2024 Esrille Inc. 3 | # This file is distributed under the same license as the furiganapad package. 4 | # Esrille Inc. , 2020-2023. 5 | # Albano Battistella , 2024. 6 | # 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: furiganapad 0.7.2\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2025-04-13 15:55+0900\n" 12 | "PO-Revision-Date: 2024-05-21 14:38+0100\n" 13 | "Last-Translator: Albano Battistella \n" 14 | "Language-Team: Italian \n" 15 | "Language: it\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | 20 | #: data/com.esrille.furiganapad.desktop.in:4 21 | #: data/com.esrille.furiganapad.metainfo.xml.in:6 src/window.py:45 22 | msgid "FuriganaPad" 23 | msgstr "FuriganaPad" 24 | 25 | #: data/com.esrille.furiganapad.desktop.in:5 26 | #: data/com.esrille.furiganapad.metainfo.xml.in:7 27 | msgid "Write Japanese text with Ruby annotations easily" 28 | msgstr "Scrivi facilmente testo giapponese con annotazioni Ruby" 29 | 30 | #: data/com.esrille.furiganapad.metainfo.xml.in:12 31 | msgid "" 32 | "With Hiragana IME for IBus, FuriganaPad automatically puts Ruby characters " 33 | "above Kanji as you type them." 34 | msgstr "" 35 | "Con Hiragana IME per IBus, FuriganaPad inserisce automaticamente i caratteri " 36 | "Ruby sopra i Kanji mentre li digiti." 37 | 38 | #: data/com.esrille.furiganapad.metainfo.xml.in:24 39 | msgid "Screenshot" 40 | msgstr "Screenshot" 41 | 42 | #: data/com.esrille.furiganapad.metainfo.xml.in:28 43 | msgid "Screen-capture" 44 | msgstr "Cattura dello schermo" 45 | 46 | #: src/application.py:49 47 | msgid "Initial window x position" 48 | msgstr "Posizione iniziale della finestra x" 49 | 50 | #: src/application.py:49 51 | msgid "x" 52 | msgstr "x" 53 | 54 | #: src/application.py:51 55 | msgid "Initial window y position" 56 | msgstr "Posizione iniziale della finestra y" 57 | 58 | #: src/application.py:51 59 | msgid "y" 60 | msgstr "y" 61 | 62 | #: src/application.py:53 63 | msgid "Initial window width" 64 | msgstr "Larghezza iniziale della finestra" 65 | 66 | #: src/application.py:53 67 | msgid "w" 68 | msgstr "w" 69 | 70 | #: src/application.py:55 71 | msgid "Initial window height" 72 | msgstr "Altezza iniziale della finestra" 73 | 74 | #: src/application.py:55 75 | msgid "h" 76 | msgstr "h" 77 | 78 | #: src/application.py:57 79 | msgid "Print version information" 80 | msgstr "Stampa le informazioni sulla versione" 81 | 82 | #: src/window.py:99 src/window.py:530 src/window.py:532 83 | msgid "Ruby" 84 | msgstr "Ruby" 85 | 86 | #: src/window.py:208 87 | msgid "Text files" 88 | msgstr "File di testo" 89 | 90 | #: src/window.py:213 91 | msgid "Python files" 92 | msgstr "File Python" 93 | 94 | #: src/window.py:218 95 | msgid "Any files" 96 | msgstr "Qualsiasi file" 97 | 98 | #: src/window.py:236 99 | msgid "Save changes to this document?" 100 | msgstr "Vuoi salvare le modifiche a questo documento?" 101 | 102 | #: src/window.py:237 103 | msgid "If you don't, changes will be lost." 104 | msgstr "In caso contrario, le modifiche andranno perse." 105 | 106 | #: src/window.py:238 107 | msgid "Close _Without Saving" 108 | msgstr "Chiudi _Senza Salvare" 109 | 110 | #: src/window.py:271 111 | msgid "Font" 112 | msgstr "Font" 113 | 114 | #: src/window.py:272 115 | msgid "The quick brown fox jumps over the lazy dog." 116 | msgstr "Ma la volpe col suo balzo ha raggiunto il quieto Fido." 117 | 118 | #: src/window.py:380 119 | msgid "Open File" 120 | msgstr "Apri file" 121 | 122 | #: src/window.py:382 123 | msgid "Open" 124 | msgstr "Apri" 125 | 126 | #: src/window.py:383 src/window.py:458 127 | msgid "Cancel" 128 | msgstr "Annulla" 129 | 130 | #: src/window.py:445 131 | msgid "Could not save the file." 132 | msgstr "Impossibile salvare il file." 133 | 134 | #: src/window.py:454 135 | msgid "Save File" 136 | msgstr "Salva File" 137 | 138 | #: src/window.py:457 139 | msgid "Save" 140 | msgstr "Salva" 141 | 142 | #: src/furiganapad.menu.ui:6 143 | msgid "_File" 144 | msgstr "_File" 145 | 146 | #: src/furiganapad.menu.ui:9 147 | msgid "_New Window" 148 | msgstr "_Nuova finestra" 149 | 150 | #: src/furiganapad.menu.ui:14 151 | msgid "_Open…" 152 | msgstr "_Apri…" 153 | 154 | #: src/furiganapad.menu.ui:21 155 | msgid "_Save" 156 | msgstr "_Salva" 157 | 158 | #: src/furiganapad.menu.ui:26 159 | msgid "Save _As…" 160 | msgstr "Salva _come…" 161 | 162 | #: src/furiganapad.menu.ui:32 163 | msgid "_Close" 164 | msgstr "_Chiudi" 165 | 166 | #: src/furiganapad.menu.ui:37 167 | msgid "_Quit" 168 | msgstr "_Esci" 169 | 170 | #: src/furiganapad.menu.ui:44 171 | msgid "_Edit" 172 | msgstr "_Modifica" 173 | 174 | #: src/furiganapad.menu.ui:47 175 | msgid "_Undo" 176 | msgstr "_Annulla" 177 | 178 | #: src/furiganapad.menu.ui:52 179 | msgid "Re_do" 180 | msgstr "Rifai" 181 | 182 | #: src/furiganapad.menu.ui:59 183 | msgid "Cu_t" 184 | msgstr "Taglia" 185 | 186 | #: src/furiganapad.menu.ui:64 187 | msgid "_Copy" 188 | msgstr "_Copia" 189 | 190 | #: src/furiganapad.menu.ui:69 191 | msgid "_Paste" 192 | msgstr "_Incolla" 193 | 194 | #: src/furiganapad.menu.ui:76 195 | msgid "Select _All" 196 | msgstr "Seleziona _tutto" 197 | 198 | #: src/furiganapad.menu.ui:83 199 | msgid "_Find…" 200 | msgstr "_Trova…" 201 | 202 | #: src/furiganapad.menu.ui:88 203 | msgid "_Replace…" 204 | msgstr "_Sostituisci…" 205 | 206 | #: src/furiganapad.menu.ui:95 207 | msgid "Ru_by…" 208 | msgstr "Ruby…" 209 | 210 | #: src/furiganapad.menu.ui:100 211 | msgid "Revert to _Hiragana" 212 | msgstr "Ritorna all'Hiragana" 213 | 214 | #: src/furiganapad.menu.ui:107 215 | msgid "_Settings" 216 | msgstr "_Impostazioni" 217 | 218 | #: src/furiganapad.menu.ui:110 219 | msgid "_Font…" 220 | msgstr "_Font…" 221 | 222 | #: src/furiganapad.menu.ui:114 223 | msgid "_Ruby" 224 | msgstr "_Ruby" 225 | 226 | #: src/furiganapad.menu.ui:119 227 | msgid "Highlight _Long Sentences" 228 | msgstr "Evidenzia _Frasi lunghe" 229 | 230 | #: src/furiganapad.menu.ui:123 231 | msgid "_Statusbar" 232 | msgstr "_Barra di stato" 233 | 234 | #: src/furiganapad.menu.ui:129 src/furiganapad.menu.ui:132 235 | msgid "_Help" 236 | msgstr "_Aiuto" 237 | 238 | #: src/furiganapad.menu.ui:137 239 | msgid "_About Furiganapad" 240 | msgstr "_Informazioni su Furiganapad" 241 | -------------------------------------------------------------------------------- /po.school/it.po: -------------------------------------------------------------------------------- 1 | # Furiganapad 2 | # Copyright (C) 2020-2024 Esrille Inc. 3 | # This file is distributed under the same license as the furiganapad package. 4 | # Esrille Inc. , 2020-2023. 5 | # Albano Battistella , 2024. 6 | # 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: furiganapad 0.7.2\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2025-04-13 15:55+0900\n" 12 | "PO-Revision-Date: 2024-05-21 15:12+0100\n" 13 | "Last-Translator: Albano Battistella \n" 14 | "Language-Team: Italian \n" 15 | "Language: it\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | 20 | #: data/com.esrille.furiganapad.desktop.in:4 21 | #: data/com.esrille.furiganapad.metainfo.xml.in:6 src/window.py:45 22 | msgid "FuriganaPad" 23 | msgstr "FuriganaPad" 24 | 25 | #: data/com.esrille.furiganapad.desktop.in:5 26 | #: data/com.esrille.furiganapad.metainfo.xml.in:7 27 | msgid "Write Japanese text with Ruby annotations easily" 28 | msgstr "Scrivi facilmente testo giapponese con annotazioni Ruby" 29 | 30 | #: data/com.esrille.furiganapad.metainfo.xml.in:12 31 | msgid "" 32 | "With Hiragana IME for IBus, FuriganaPad automatically puts Ruby characters " 33 | "above Kanji as you type them." 34 | msgstr "" 35 | "Con Hiragana IME per IBus, FuriganaPad inserisce automaticamente i caratteri " 36 | "Ruby sopra i Kanji mentre li digiti." 37 | 38 | #: data/com.esrille.furiganapad.metainfo.xml.in:24 39 | msgid "Screenshot" 40 | msgstr "Screenshot" 41 | 42 | #: data/com.esrille.furiganapad.metainfo.xml.in:28 43 | msgid "Screen-capture" 44 | msgstr "Cattura dello schermo" 45 | 46 | #: src/application.py:49 47 | msgid "Initial window x position" 48 | msgstr "Posizione iniziale della finestra x" 49 | 50 | #: src/application.py:49 51 | msgid "x" 52 | msgstr "x" 53 | 54 | #: src/application.py:51 55 | msgid "Initial window y position" 56 | msgstr "Posizione iniziale della finestra y" 57 | 58 | #: src/application.py:51 59 | msgid "y" 60 | msgstr "y" 61 | 62 | #: src/application.py:53 63 | msgid "Initial window width" 64 | msgstr "Larghezza iniziale della finestra" 65 | 66 | #: src/application.py:53 67 | msgid "w" 68 | msgstr "w" 69 | 70 | #: src/application.py:55 71 | msgid "Initial window height" 72 | msgstr "Altezza iniziale della finestra" 73 | 74 | #: src/application.py:55 75 | msgid "h" 76 | msgstr "h" 77 | 78 | #: src/application.py:57 79 | msgid "Print version information" 80 | msgstr "Stampa le informazioni sulla versione" 81 | 82 | #: src/window.py:99 src/window.py:530 src/window.py:532 83 | msgid "Ruby" 84 | msgstr "Ruby" 85 | 86 | #: src/window.py:208 87 | msgid "Text files" 88 | msgstr "File di testo" 89 | 90 | #: src/window.py:213 91 | msgid "Python files" 92 | msgstr "File di Python" 93 | 94 | #: src/window.py:218 95 | msgid "Any files" 96 | msgstr "Qualsiasi file" 97 | 98 | #: src/window.py:236 99 | msgid "Save changes to this document?" 100 | msgstr "Vuoi salvare le modifiche a questo documento?" 101 | 102 | #: src/window.py:237 103 | msgid "If you don't, changes will be lost." 104 | msgstr "In caso contrario, le modifiche andranno perse." 105 | 106 | #: src/window.py:238 107 | msgid "Close _Without Saving" 108 | msgstr "Chiudi senza salvare" 109 | 110 | #: src/window.py:271 111 | msgid "Font" 112 | msgstr "Font" 113 | 114 | #: src/window.py:272 115 | msgid "The quick brown fox jumps over the lazy dog." 116 | msgstr "Ma la volpe col suo balzo ha raggiunto il quieto Fido." 117 | 118 | #: src/window.py:380 119 | msgid "Open File" 120 | msgstr "Apri file" 121 | 122 | #: src/window.py:382 123 | msgid "Open" 124 | msgstr "Apri" 125 | 126 | #: src/window.py:383 src/window.py:458 127 | msgid "Cancel" 128 | msgstr "Annulla" 129 | 130 | #: src/window.py:445 131 | msgid "Could not save the file." 132 | msgstr "Impossibile salvare il file." 133 | 134 | #: src/window.py:454 135 | msgid "Save File" 136 | msgstr "Salva file" 137 | 138 | #: src/window.py:457 139 | msgid "Save" 140 | msgstr "Salva" 141 | 142 | #: src/furiganapad.menu.ui:6 143 | msgid "_File" 144 | msgstr "_File" 145 | 146 | #: src/furiganapad.menu.ui:9 147 | msgid "_New Window" 148 | msgstr "_Nuova finestra" 149 | 150 | #: src/furiganapad.menu.ui:14 151 | msgid "_Open…" 152 | msgstr "_Apri…" 153 | 154 | #: src/furiganapad.menu.ui:21 155 | msgid "_Save" 156 | msgstr "_Salva" 157 | 158 | #: src/furiganapad.menu.ui:26 159 | msgid "Save _As…" 160 | msgstr "Salva _come…" 161 | 162 | #: src/furiganapad.menu.ui:32 163 | msgid "_Close" 164 | msgstr "_Chiudi" 165 | 166 | #: src/furiganapad.menu.ui:37 167 | msgid "_Quit" 168 | msgstr "_Esci" 169 | 170 | #: src/furiganapad.menu.ui:44 171 | msgid "_Edit" 172 | msgstr "_Modifica" 173 | 174 | #: src/furiganapad.menu.ui:47 175 | msgid "_Undo" 176 | msgstr "_Annulla" 177 | 178 | #: src/furiganapad.menu.ui:52 179 | msgid "Re_do" 180 | msgstr "Rifare" 181 | 182 | #: src/furiganapad.menu.ui:59 183 | msgid "Cu_t" 184 | msgstr "Taglia" 185 | 186 | #: src/furiganapad.menu.ui:64 187 | msgid "_Copy" 188 | msgstr "_Copia" 189 | 190 | #: src/furiganapad.menu.ui:69 191 | msgid "_Paste" 192 | msgstr "_Incolla" 193 | 194 | #: src/furiganapad.menu.ui:76 195 | msgid "Select _All" 196 | msgstr "Seleziona _tutto" 197 | 198 | #: src/furiganapad.menu.ui:83 199 | msgid "_Find…" 200 | msgstr "_Trova…" 201 | 202 | #: src/furiganapad.menu.ui:88 203 | msgid "_Replace…" 204 | msgstr "_Sostituisci…" 205 | 206 | #: src/furiganapad.menu.ui:95 207 | msgid "Ru_by…" 208 | msgstr "Ruby…" 209 | 210 | #: src/furiganapad.menu.ui:100 211 | msgid "Revert to _Hiragana" 212 | msgstr "Ritorna all'Hiragana" 213 | 214 | #: src/furiganapad.menu.ui:107 215 | msgid "_Settings" 216 | msgstr "_Impostazioni" 217 | 218 | #: src/furiganapad.menu.ui:110 219 | msgid "_Font…" 220 | msgstr "_Font…" 221 | 222 | #: src/furiganapad.menu.ui:114 223 | msgid "_Ruby" 224 | msgstr "_Ruby" 225 | 226 | #: src/furiganapad.menu.ui:119 227 | msgid "Highlight _Long Sentences" 228 | msgstr "Evidenzia _Frasi lunghe" 229 | 230 | #: src/furiganapad.menu.ui:123 231 | msgid "_Statusbar" 232 | msgstr "_Barra di stato" 233 | 234 | #: src/furiganapad.menu.ui:129 src/furiganapad.menu.ui:132 235 | msgid "_Help" 236 | msgstr "_Aiuto" 237 | 238 | #: src/furiganapad.menu.ui:137 239 | msgid "_About Furiganapad" 240 | msgstr "_Informazioni su Furiganapad" 241 | -------------------------------------------------------------------------------- /src/application.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019-2025 Esrille Inc. 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, see . 16 | 17 | import logging 18 | import os 19 | 20 | import gi 21 | gi.require_version('Gdk', '3.0') 22 | gi.require_version('Gtk', '3.0') 23 | from gi.repository import GLib, Gdk, Gio, Gtk 24 | 25 | import package 26 | from package import _ 27 | from window import DEFAULT_HEIGHT, DEFAULT_WIDTH, Window 28 | 29 | 30 | LOGGER = logging.getLogger(__name__) 31 | 32 | 33 | class Application(Gtk.Application): 34 | 35 | def __init__(self, *args, **kwargs): 36 | super().__init__(*args, 37 | application_id='com.esrille.furiganapad', 38 | flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE, 39 | **kwargs) 40 | self.cursor = None 41 | 42 | self.window_x = None 43 | self.window_y = None 44 | self.window_width = None 45 | self.window_height = None 46 | 47 | # e.g., --window-x=2560 --window-y=32 --window-width=1024 --window-height=600 48 | self.add_main_option('window-x', ord('x'), GLib.OptionFlags.NONE, GLib.OptionArg.INT, 49 | _('Initial window x position'), _('x')) 50 | self.add_main_option('window-y', ord('y'), GLib.OptionFlags.NONE, GLib.OptionArg.INT, 51 | _('Initial window y position'), _('y')) 52 | self.add_main_option('window-width', ord('w'), GLib.OptionFlags.NONE, GLib.OptionArg.INT, 53 | _('Initial window width'), _('w')) 54 | self.add_main_option('window-height', ord('h'), GLib.OptionFlags.NONE, GLib.OptionArg.INT, 55 | _('Initial window height'), _('h')) 56 | self.add_main_option('version', ord('v'), GLib.OptionFlags.NONE, GLib.OptionArg.NONE, 57 | _('Print version information'), None) 58 | 59 | def do_activate(self): 60 | pathname = os.path.join(package.get_user_datadir(), 'session') 61 | LOGGER.info(f'do_activate: {pathname}') 62 | try: 63 | with open(pathname, 'r') as file: 64 | for line in file: 65 | if line.startswith('#'): 66 | continue 67 | # f'furiganapad -x {x} -y {y} -w {w} -h {h} {path} &\n' 68 | if not line.startswith('furiganapad '): 69 | continue 70 | args = line.split() 71 | if len(args) < 10: 72 | continue 73 | x = int(args[2]) 74 | y = int(args[4]) 75 | w = int(args[6]) 76 | h = int(args[8]) 77 | path = args[9] 78 | LOGGER.info(f'do_activate: -x {x} -y {y} -w {w} -h {h} {path}') 79 | file = Gio.File.new_for_path(path) 80 | win = self.is_opened(file) 81 | if win: 82 | win.present() 83 | elif os.path.isfile(path): 84 | win = Window(self, file=file) 85 | win.show_all() 86 | win.move(x, y) 87 | win.resize(w, h) 88 | except OSError: 89 | LOGGER.debug(f"Could not read '{pathname}'") 90 | except TypeError: 91 | LOGGER.debug(f"Broken session file '{pathname}'") 92 | if 0 < len(self.get_windows()): 93 | return 94 | win = Window(self) 95 | win.show_all() 96 | win.move(self.window_x, self.window_y) 97 | win.resize(self.window_width, self.window_height) 98 | 99 | def do_command_line(self, command_line): 100 | # call the default command line handler 101 | Gtk.Application.do_command_line(self, command_line) 102 | 103 | screen = Gdk.Screen.get_default() 104 | n = screen.get_primary_monitor() 105 | monitor_n_geo = screen.get_monitor_geometry(n) 106 | 107 | options = command_line.get_options_dict() 108 | 109 | if options.contains('version'): 110 | print(package.get_name() + ' ' + package.get_version()) 111 | return 0 112 | 113 | value = options.lookup_value('window-x', GLib.VariantType.new('i')) 114 | self.window_x = value.get_int32() if value else monitor_n_geo.x 115 | value = options.lookup_value('window-y', GLib.VariantType.new('i')) 116 | self.window_y = value.get_int32() if value else monitor_n_geo.y 117 | value = options.lookup_value('window-width', GLib.VariantType.new('i')) 118 | self.window_width = value.get_int32() if value else DEFAULT_WIDTH 119 | value = options.lookup_value('window-height', GLib.VariantType.new('i')) 120 | self.window_height = value.get_int32() if value else DEFAULT_HEIGHT 121 | 122 | args = command_line.get_arguments() 123 | LOGGER.info(args[0]) # /app/share/furiganapad/src/main.py if runs in sandbox 124 | args = args[1:] 125 | if args: 126 | files = [] 127 | for pathname in args: 128 | files.append(command_line.create_file_for_arg(pathname)) 129 | self.do_open(files, '') 130 | else: 131 | self.do_activate() 132 | return 0 133 | 134 | def do_open(self, files, hint): 135 | for file in files: 136 | win = self.is_opened(file) 137 | if win: 138 | win.present() 139 | else: 140 | win = Window(self, file=file) 141 | win.show_all() 142 | if len(files) == 1: 143 | win.move(self.window_x, self.window_y) 144 | win.resize(self.window_width, self.window_height) 145 | if not self.cursor: 146 | self.cursor = Gdk.Cursor.new_from_name(win.get_display(), 'default') 147 | 148 | def do_startup(self): 149 | Gtk.Application.do_startup(self) 150 | 151 | resource_path = os.path.join(package.get_datadir(), 'furiganapad.gresource') 152 | resource = Gio.Resource.load(resource_path) 153 | resource._register() 154 | 155 | builder = Gtk.Builder() 156 | builder.set_translation_domain(package.get_domain()) 157 | builder.add_from_resource('/com/esrille/furiganapad/furiganapad.menu.ui') 158 | self.set_menubar(builder.get_object('menubar')) 159 | 160 | style_provider = Gtk.CssProvider() 161 | style_provider.load_from_path(os.path.join(os.path.dirname(__file__), 'furiganapad.css')) 162 | Gtk.StyleContext.add_provider_for_screen( 163 | Gdk.Screen.get_default(), 164 | style_provider, 165 | Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION) 166 | 167 | action = Gio.SimpleAction.new('quit', None) 168 | action.connect('activate', self.on_quit) 169 | self.add_action(action) 170 | 171 | def is_opened(self, file): 172 | windows = self.get_windows() 173 | for window in windows: 174 | if window.get_file() and window.get_file().equal(file): 175 | return window 176 | return None 177 | 178 | def get_default_cursor(self): 179 | return self.cursor 180 | 181 | def on_quit(self, *args): 182 | pathname = os.path.join(package.get_user_datadir(), 'session') 183 | LOGGER.info(f'on_quit: {pathname}') 184 | try: 185 | descriptor = os.open(pathname, os.O_WRONLY | os.O_CREAT | os.O_TRUNC) 186 | with open(descriptor, 'w') as file: 187 | file.write('#!/bin/sh\n') 188 | windows = self.get_windows() 189 | for window in windows: 190 | x, y = window.get_position() 191 | w, h = window.get_size() 192 | window.present() 193 | window.lookup_action('close').activate() 194 | if window.get_file(): 195 | path = window.get_file().get_path() 196 | file.write(f'furiganapad -x {x} -y {y} -w {w} -h {h} {path} &\n') 197 | except OSError: 198 | LOGGER.exception(f"Could not create '{pathname}'") 199 | if 0 < len(self.get_windows()): 200 | return 201 | -------------------------------------------------------------------------------- /docs/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: sans-serif; 3 | font-size: 12pt; 4 | line-height: 2.1em; 5 | background-color: white; 6 | } 7 | a { 8 | background-color: transparent; 9 | color: #4183C4; 10 | text-decoration: none; 11 | } 12 | a:hover { 13 | text-decoration: underline; 14 | } 15 | h1, h2, h3, h4, h5, h6 { 16 | margin: 32px 0 16px; 17 | padding: 0; 18 | font-weight: bold; 19 | position: relative; 20 | text-align: left; 21 | } 22 | h1 { 23 | margin-bottom: 40px; 24 | font-size: 18pt; 25 | border-bottom: 1px solid #ccc; 26 | } 27 | h2 { 28 | font-size: 16pt; 29 | } 30 | h3 { 31 | font-size: 14pt; 32 | } 33 | h4 { 34 | font-size: 12pt; 35 | } 36 | h5 { 37 | font-size: 12pt; 38 | } 39 | h6 { 40 | font-size: 12pt; 41 | } 42 | img, video { 43 | border-style: none; 44 | max-width: 100%; 45 | margin-top: 1em; 46 | margin-bottom: 1em; 47 | } 48 | code, tt, kbd, pre { 49 | font-family: monospace; 50 | font-size: 1em; 51 | } 52 | hr { 53 | border: 0 none; 54 | border-bottom: 2px solid #eee; 55 | color: #ccc; 56 | } 57 | blockquote { 58 | padding: 0 1em; 59 | border-left: 0.25em solid #dfe2e5; 60 | } 61 | blockquote>:first-child { 62 | margin-top: 0; 63 | } 64 | blockquote>:last-child { 65 | margin-bottom: 0; 66 | } 67 | table { 68 | border-spacing: 0; 69 | border-collapse: collapse; 70 | display: block; 71 | width: 100%; 72 | overflow: auto; 73 | } 74 | table th, table td { 75 | padding: 6px 13px; 76 | border: 1px solid #dfe2e5; 77 | } 78 | table th { 79 | text-align: center; 80 | } 81 | table tr { 82 | background-color: #fff; 83 | } 84 | table th, table tr:nth-child(2n) { 85 | background-color: #f6f8fa; 86 | } 87 | p, blockquote, ul, ol, dl, table { 88 | margin: 1em 0; 89 | } 90 | h1 + p, h2 + p, h3 + p, h4 + p, h5 + p, h6 + p { 91 | margin-top: 0; 92 | } 93 | ul, ol { 94 | padding-left: 2em; 95 | } 96 | ul :first-child, ol :first-child { 97 | margin-top: 0; 98 | } 99 | ul :last-child, ol :last-child { 100 | margin-bottom: 0; 101 | } 102 | pre { 103 | margin: 8px; 104 | padding: 8px; 105 | background-color: #f6f8fa; 106 | border: 1px solid #ccc; 107 | border-radius: 3px; 108 | text-align: left; 109 | overflow: auto; 110 | } 111 | code { 112 | word-wrap: normal; 113 | word-break: normal; 114 | white-space: pre; 115 | text-align: left; 116 | } 117 | .highlight { 118 | margin-bottom: 16px; 119 | } 120 | .highlight pre, .highlight code { 121 | margin-bottom: 0; 122 | } 123 | kbd { 124 | display: inline-block; 125 | padding: 3px 5px; 126 | line-height: 10px; 127 | color: #444d56; 128 | vertical-align: middle; 129 | background-color: #fafbfc; 130 | border: solid 1px #d1d5da; 131 | border-bottom-color: #c6cbd1; 132 | border-radius: 3px; 133 | } 134 | dd { 135 | margin-left: 0; 136 | } 137 | dl { 138 | padding: 0; 139 | } 140 | dl dt { 141 | padding: 0; 142 | margin-top: 1em; 143 | font-size: 1em; 144 | font-style: italic; 145 | font-weight: 600; 146 | } 147 | dl dd { 148 | padding: 0 1em; 149 | margin-bottom: 1em; 150 | } 151 | img + em { 152 | display: block; 153 | color: black; 154 | text-indent: 2em; 155 | font-family: sans-serif; 156 | font-size: smaller; 157 | font-style: normal; 158 | } 159 | h1, h2, h3, h4, h5, h6, strong, th { 160 | font-family: sans-serif; 161 | } 162 | a { 163 | font-weight: normal; 164 | text-decoration: none; 165 | } 166 | 167 | /* screen layout */ 168 | body { 169 | margin: 0; 170 | padding: 0; 171 | } 172 | #sidebar { 173 | position: fixed; 174 | top: 0; 175 | width: 24%; 176 | height: 100%; 177 | margin: 0; 178 | padding: 0; 179 | } 180 | #sidebar > aside { 181 | float: right; 182 | padding: 10px 30px; 183 | } 184 | aside > ul { 185 | background-color: #eee; 186 | } 187 | nav a { 188 | height: 10em; 189 | width: 1.5em; 190 | text-align: center; 191 | background-color: #3af; 192 | color: white; 193 | line-height: 10em; 194 | } 195 | nav a:hover { 196 | text-decoration: none; 197 | } 198 | #nav-prev { 199 | position: fixed; 200 | top: 40%; 201 | left: 0; 202 | } 203 | #nav-next { 204 | position: fixed; 205 | top: 40%; 206 | right: 0; 207 | } 208 | main { 209 | display: block; 210 | -webkit-text-size-adjust: 100%; 211 | margin-left: 24%; 212 | max-width: 720px; 213 | text-align: justify; 214 | padding: 10px 30px; 215 | } 216 | main > :first-child { 217 | margin-top: 0 !important; 218 | } 219 | main > *:last-child { 220 | margin-bottom: 0 !important; 221 | } 222 | main > p { 223 | margin-top: 0; 224 | margin-bottom: 0; 225 | } 226 | footer { 227 | text-align: right; 228 | font-size: smaller; 229 | } 230 | 231 | .red { 232 | color: #e13402; 233 | } 234 | .blue { 235 | color: #0071bc; 236 | } 237 | .help-text { 238 | color: dimgray; 239 | font-size: 90%; 240 | } 241 | .card { 242 | background-color: whitesmoke; 243 | padding: 12px; 244 | border: solid 2px silver; 245 | border-radius: 8px; 246 | } 247 | .card > h2 { 248 | margin: 0.5em 0; 249 | } 250 | .card table tr { 251 | background-color: #fff; 252 | } 253 | .card table th { 254 | background-color: #fff; 255 | } 256 | 257 | @media only screen and (max-width: 1050px) { 258 | 259 | #sidebar { 260 | position: static; 261 | width: 100%; 262 | } 263 | #sidebar > aside { 264 | float: none; 265 | padding: 10px 30px; 266 | } 267 | 268 | main { 269 | margin-left: 0; 270 | max-width: 720px; 271 | text-align: justify; 272 | padding: 10px 30px; 273 | } 274 | 275 | } /* @media only screen and (max-width: 1024px) */ 276 | 277 | @media screen and (max-width: 360px) { 278 | body { 279 | font-size: 10.5pt; 280 | } 281 | } 282 | 283 | @media print { 284 | body { 285 | font-size: 10.5pt; 286 | } 287 | #nav-prev, #nav-next { 288 | display: none; 289 | } 290 | } 291 | 292 | body:lang(ja), a:lang(ja) { 293 | font-family: "Noto Sans CJK JP", "IPA Pゴシック", "游ゴシック Medium","Yu Gothic Medium", 游ゴシック体, "Yu Gothic", YuGothic, sans-serif; 294 | } 295 | em:lang(ja), h1:lang(ja), h2:lang(ja), h3:lang(ja), h4:lang(ja), h5:lang(ja), h6:lang(ja), strong:lang(ja), th:lang(ja) { 296 | font-family: "Noto Sans CJK JP", "IPA Pゴシック", "游ゴシック Medium","Yu Gothic Medium", 游ゴシック体, "Yu Gothic", YuGothic, sans-serif; 297 | font-style: normal; 298 | font-weight: 500; 299 | } 300 | 301 | .kbd { 302 | position: relative; 303 | height: 260px; 304 | white-space: nowrap; 305 | font-family: sans-serif; 306 | font-size: 14px; 307 | } 308 | .layer { 309 | position: absolute; 310 | } 311 | .layer>div { 312 | display: inline-block; 313 | padding: 1px; 314 | width: 45px; 315 | height: 45px; 316 | margin: 1px; 317 | vertical-align: bottom; 318 | } 319 | .layer>.k125 { 320 | width: 57px; 321 | } 322 | .layer>.k150 { 323 | padding: 0 12px; 324 | } 325 | .layer>.k175 { 326 | width: 82px; 327 | } 328 | .layer>.k200 { 329 | width: 93px; 330 | } 331 | .layer>.k225 { 332 | width: 105px; 333 | } 334 | .layer>.k275 { 335 | width: 131px; 336 | } 337 | .layer>.k625 { 338 | width: 303px; 339 | } 340 | .layer109 { 341 | position: absolute; 342 | } 343 | .layer109>div { 344 | display: inline-block; 345 | padding: 1px; 346 | width: 45px; 347 | height: 45px; 348 | margin: 1px; 349 | vertical-align: bottom; 350 | } 351 | .layer109>.k125 { 352 | width: 57px; 353 | } 354 | .layer109>.k150 { 355 | width: 69.5px; 356 | } 357 | .layer109>.k175 { 358 | width: 82px; 359 | } 360 | .layer109>.k200 { 361 | width: 93px; 362 | } 363 | .layer109>.k225 { 364 | width: 106px; 365 | } 366 | .layer109>.k250 { 367 | width: 120px; 368 | } 369 | .layer109>.k275 { 370 | width: 133px; 371 | } 372 | .layer109>.k350 { 373 | width: 167px; 374 | } 375 | .layer109>.k375 { 376 | width: 180px; 377 | } 378 | .layer109>.k400 { 379 | width: 193px; 380 | } 381 | .layer109>.k625 { 382 | width: 303px; 383 | } 384 | .layer109 .enter-top { 385 | border-bottom-right-radius: 0; 386 | } 387 | .layer109 .enter-bottom { 388 | position: relative; 389 | border-top-left-radius: 0; 390 | border-top-right-radius: 0; 391 | } 392 | .layer109 .enter-middle { 393 | position: relative; 394 | left: -1px; 395 | top: -4px; 396 | background: white; 397 | width: 57px; 398 | height: 10px; 399 | border-style: solid; 400 | border-width: 0 1px; 401 | } 402 | .small { 403 | display: inline-block; 404 | border: 1px solid #ccc; 405 | width: 13px; 406 | text-align: center; 407 | line-height: 13px; 408 | font-size: 13px; 409 | } 410 | .kana { 411 | color: #1c9; 412 | font-size: 13px; 413 | } 414 | .kana-border { 415 | border: 1px solid #3c6; 416 | } 417 | 418 | .a { 419 | color: #f30 420 | } 421 | .k { 422 | color: #f40 423 | } 424 | .s { 425 | color: #f83 426 | } 427 | .t { 428 | color: #0c6 429 | } 430 | .n { 431 | color: #099 432 | } 433 | .h { 434 | color: #09f 435 | } 436 | .m { 437 | color: #39f 438 | } 439 | .y { 440 | color: #86f 441 | } 442 | .r { 443 | color: #b6f 444 | } 445 | .w { 446 | color: #c3c 447 | } 448 | .x { 449 | color: #f3c 450 | } 451 | 452 | .L0 { 453 | top: 2px; 454 | left: 12px; 455 | } 456 | .L0>div { 457 | padding: 0; 458 | border: solid 1px black; 459 | border-radius: 4px; 460 | text-align: center; 461 | line-height: 45px; 462 | } 463 | .L1 { 464 | top: 2px; 465 | left: 14px; 466 | line-height: 45px; 467 | } 468 | .L2 { 469 | top: 2px; 470 | left: 12px; 471 | text-align: center; 472 | } 473 | .L3 { 474 | top: 15px; 475 | left: 12px; 476 | text-align: center; 477 | line-height: 45px; 478 | color: #666; 479 | } 480 | .L4 { 481 | top: 4px; 482 | left: 42px; 483 | line-height: 45px; 484 | color: #666; 485 | } 486 | 487 | .key { 488 | display: inline-block; 489 | padding: 2px; 490 | border: 1px solid #888; 491 | border-radius: 4px; 492 | line-height: 14px; 493 | font-size: 14px; 494 | height: 16px; 495 | } 496 | -------------------------------------------------------------------------------- /docs/usage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | つかいかた ― ふりがなパッド 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 25 | 26 | 27 | 43 |
44 | 49 | 50 |

つかいかた

51 |

起動(きどう)のしかた

52 |

 アプリケーションの一覧(いちらん)から[ふりがなパッド]のアイコンを選択(せんたく)します。

53 |

ペイントのアイコン

54 |

 プログラムのファイル名は"furiganapad"です。

55 |

 「ふりがなパッド」が起動(きどう)すると、したのようなウィンドウがひらきます。

56 |

<ruby>起動<rp>(</rp><rt>きどう</rt><rp>)</rp></ruby><ruby>画面<rp>(</rp><rt>がめん</rt><rp>)</rp></ruby>メニュー

57 |

 このウィンドウのなかで、すぐに文章(ぶんしょう)をかくことができます。文字(もじ)はカーソル(|)の位置(いち)挿入(そうにゅう)されます。

58 |

 「ふりがなパッド」をコマンド ラインから起動(きどう)したいときは、つぎのようにタイプします。

59 |
$ furiganapad [ファイル名...]
 60 | 
61 |

 ファイル(めい)部分(ぶぶん)には、ひらきたいファイルのなまえをタイプします。あたらしいファイルをつくるときは、ファイル(めい)指定(してい)しなくてもかまいません。

62 |

基本的(きほんてき)なキー操作(そうさ)

63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 |
キー内容(ないよう)
カーソルキー
[←], [↑], [↓], [→]
 カーソルをうごかします。
 [Shift(シフト)]キーをおさえながらカーソルキーをおすと、テキストを選択(せんたく)できます。
 [Ctrl(コントロール)]キーをおさえながらカーソルキーをおすと、単語(たんご)単位(たんい)でカーソルがうごきます。
[Backspace(バックスペース)] 選択(せんたく)しているテキストがあるときは、その部分(ぶぶん)削除(さくじょ)します。そうでなければ、カーソルの直前(ちょくぜん)文字(もじ)削除(さくじょ)します。
[Enter(エンター)] あたらしい段落(だんらく)をつくります。
[Home(ホーム)] カーソルを段落(だんらく)のはじめに移動(いどう)します。
 [Ctrl(コントロール)]キーをおさえながら[Home(ホーム)]キーをおすと、カーソルが文頭(ぶんとう)移動(いどう)します。
[End(エンド)] カーソルを段落(だんらく)のおわりに移動(いどう)します。
 [Ctrl(コントロール)]キーをおさえながら[End(エンド)]キーをおすと、カーソルが文末(ぶんまつ)移動(いどう)します。
[Page(ページ) Up(アップ)] 画面(がめん)(うえ)にスクロールします。
[Page(ページ) Down(ダウン)] 画面(がめん)(した)にスクロールします。
101 |

文章(ぶんしょう)保存(ほぞん)のしかた

102 |

 かいた文章(ぶんしょう)は、ファイルに保存(ほぞん)しておかないと、なくなってしまいます。文章(ぶんしょう)保存(ほぞん)するときは、まず、[ファイル]メニューをクリックします。そうすると、プルダウン メニューがひらきます。そのなかから[保存(ほぞん)]をクリックすると、文章(ぶんしょう)保存(ほぞん)できます。

103 |

 おもなメニュー項目(こうもく)はキーボード ショートカットをつかって実行(じっこう)することもできます。たとえば、[保存(ほぞん)]は、[Ctrl(コントロール)]キーをおさえながら、[S]をおすと実行(じっこう)できます。Sは英語(えいご)の"Save(セーブ)"の(かしら)文字(もじ)からきています。キーボード ショートカットはプルダウン メニューのなかにかかれています。

104 |

ファイル メニュー

105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 |
メニュー項目(こうもく)内容(ないよう)
(あたら)しいウィンドウ
[Ctrl]+[N]
 あたらしい文章(ぶんしょう)をかくためのウィンドウをひらきます。
(ひら)く...
[Ctrl]+[O]
 ファイルをひらきます。
保存(ほぞん)
[Ctrl]+[S]
 文章(ぶんしょう)保存(ほぞん)します。あたらしい文章(ぶんしょう)保存(ほぞん)するときは、ファイル(めい)指定(してい)してから保存(ほぞん)します。
名前(なまえ)をつけて保存(ほぞん)... 文章(ぶんしょう)をべつのファイルに保存(ほぞん)します。
()じる
[Ctrl]+[W]
 ファイルをとじます。文章(ぶんしょう)変更(へんこう)していたときは、ファイルを保存(ほぞん)しなくてもだいじょうぶか確認(かくにん)をもとめられます。
終了(しゅうりょう)
[Ctrl]+[Q]
 ファイルをすべてとじます。変更(へんこう)されている文章(ぶんしょう)があれば、それぞれ保存(ほぞん)しなくてもだいじょうぶか確認(かくにん)をもとめられます。
139 |

編集(へんしゅう)メニュー

140 |

 編集(へんしゅう)メニューをつかうと、選択(せんたく)した部分(ぶぶん)をきりとったり、ルビをふりなおしたりすることができます。

141 |

 編集(へんしゅう)メニューのキーボード ショートカットは、ほんどのアプリケーション ソフトウェアがおなじキーボード ショートカットをつかっています。よくつかう命令(めいれい)のキーボード ショートカットはおぼえておくとべんりです。

142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 |
メニュー項目(こうもく)内容(ないよう)
(もと)(もど)
[Ctrl]+[Z]
 まちがえた操作(そうさ)をとりけして、もとにもどします。
やり(なお)
[Ctrl]+[Shift]+[Z]
 いちどとりけした操作(そうさ)をやりなおします。
()()
[Ctrl]+[X]
 選択(せんたく)したテキストをきりとって、クリップボードにいれます。
コピー
[Ctrl]+[C]
 選択(せんたく)したテキストをコピーして、クリップボードにいれます。
()()
[Ctrl]+[V]
 クリップボードにいれたテキストを本文(ほんぶん)にはりつけます。
すべて選択(せんたく)
[Ctrl]+[A]
 文章(ぶんしょう)全体(ぜんたい)選択(せんたく)します。
検索(けんさく)...
[Ctrl]+[F]
 ウィンドウのしたがわにテキストボックスが表示(ひょうじ)されます。テキストボックスに字句(じく)入力(にゅうりょく)して、[Enter(エンター)]キーをおすと、文章(ぶんしょう)のなかからその字句(じく)をさがします。
 [Esc(エスケープ)]キーをおすと、テキストボックスをとじられます。
置換(ちかん)...
[Ctrl]+[H]
 ウィンドウのしたがわに、ふたつテキストボックスが表示(ひょうじ)されます。うえのテキストボックスには、さがしたい字句(じく)入力(にゅうりょく)します。したのテキストボックスには、おきかえる字句(じく)入力(にゅうりょく)します。[Enter(エンター)]キーをおすと、さがしたい字句(じく)があれば、その字句(じく)選択(せんたく)されます。そこで、もういちど[Enter(エンター)]キーをおすと、字句(じく)をおきかえられます。
 [Esc(エスケープ)]キーをおすと、テキストボックスをとじられます。
ルビをふる...
[Ctrl]+[B]
 まずルビをふりたい字句(じく)選択(せんたく)しておきます。このコマンドを実行(じっこう)すると、ウィンドウのしたがわにテキストボックスが表示(ひょうじ)されます。ルビを入力(にゅうりょく)して、[Enter(エンター)]キーをおすと、選択(せんたく)したテキストにルビがふられます。
 [Esc(エスケープ)]キーをおすと、テキストボックスをとじられます。
ひらがなに(もど)
[Ctrl]+[T]
 まずルビがふられている字句(じく)のすぐあとにカーソルを移動(いどう)しておきます。このコマンドを実行(じっこう)すると、ルビのふられている漢字(かんじ)をひらがなにもどせます。
192 |

設定(せってい)メニュー

193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 |
メニュー項目(こうもく)内容(ないよう)
フォントを()える 文章(ぶんしょう)表示(ひょうじ)につかうフォントをえらびます。
ルビをふる
[Ctrl]+[R]
 チェックをつけておくと、変換(へんかん)した漢字(かんじ)自動的(じどうてき)にルビがふられます。
※ 「ひらがなIME」を使用(しよう)しているときにだけ有効(ゆうこう)機能(きのう)です。
(なが)(ぶん)をめだたせる チェックをつけておくと、ながい(ぶん)(いろ)づけして表示(ひょうじ)します。一(ぶん)のながさが50()をこえると、(ぶん)背景(はいけい)()(いろ)になります。さらに、60()をこえると、(ぶん)背景(はいけい)赤色( あかいろ)になります。
 ながい(ぶん)はみじかくきって、かきなおすと、よみやすくなります。背景(はいけい)赤色( あかいろ)になっている(ぶん)は、ふたつの(ぶん)にわけたりできないか、かんがえてみてください。
ステータスバー チェックをつけておくと、ウィンドウのしたの部分(ぶぶん)にステータスバーを表示(ひょうじ)します。
219 |

ヘルプ メニュー

220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 |
メニュー項目(こうもく)内容(ないよう)
ヘルプ
[F1]
 ウェブブラウザーで「ふりがなパッド」の()びきのページを表示(ひょうじ)します。
ふりがなパッドについて 「ふりがなパッド」のバージョン情報(じょうほう)などを表示(ひょうじ)します。
238 |
239 | 243 | 244 | 245 | -------------------------------------------------------------------------------- /src/window.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019-2025 Esrille Inc. 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, see . 16 | 17 | import logging 18 | import os 19 | import subprocess 20 | 21 | import gi 22 | gi.require_version('Gtk', '3.0') 23 | gi.require_version('Pango', '1.0') 24 | from gi.repository import GLib, Gdk, Gio, Gtk, Pango 25 | 26 | import package 27 | from package import _ 28 | from textbuffer import get_plain_text, remove_dangling_annotations 29 | from textview import FuriganaView 30 | 31 | 32 | LOGGER = logging.getLogger(__name__) 33 | 34 | IAA = '\uFFF9' # IAA (INTERLINEAR ANNOTATION ANCHOR) 35 | IAS = '\uFFFA' # IAS (INTERLINEAR ANNOTATION SEPARATOR) 36 | IAT = '\uFFFB' # IAT (INTERLINEAR ANNOTATION TERMINATOR) 37 | 38 | DEFAULT_WIDTH = 720 39 | DEFAULT_HEIGHT = 512 40 | 41 | 42 | class Window(Gtk.ApplicationWindow): 43 | 44 | def __init__(self, app, file=None): 45 | self.title = _('FuriganaPad') 46 | super().__init__(application=app, title=self.title) 47 | self.set_default_icon_name(package.get_name()) 48 | self.set_default_size(DEFAULT_WIDTH, DEFAULT_HEIGHT) 49 | 50 | grid = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) 51 | self.add(grid) 52 | 53 | scrolled_window = Gtk.ScrolledWindow() 54 | scrolled_window.set_hexpand(True) 55 | scrolled_window.set_vexpand(True) 56 | scrolled_window.set_policy( 57 | Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) 58 | 59 | self.textview = FuriganaView() 60 | self.textview.connect_after('focus-in-event', self.on_textview_focus_in) 61 | self.textview.connect_after('focus-out-event', self.on_textview_focus_out) 62 | 63 | self.buffer = self.textview.get_buffer() 64 | self.buffer.connect_after('modified-changed', self.on_modified_changed) 65 | self.buffer.connect_after('mark-set', self.on_mark_set) 66 | 67 | scrolled_window.add(self.textview) 68 | grid.pack_start(scrolled_window, True, True, 0) 69 | 70 | self.searchbar = Gtk.SearchBar() 71 | # We use Gtk.Entry since Gtk.SearchEntry does not support IME 72 | # at this point. 73 | self.search_entry = Gtk.Entry() 74 | self.searchbar.add(self.search_entry) 75 | self.searchbar.connect_entry(self.search_entry) 76 | grid.pack_start(self.searchbar, False, False, 0) 77 | self.searchbar.set_search_mode(False) 78 | self.search_entry.connect('activate', self.on_find) 79 | self.search_entry_text = '' 80 | 81 | self.replacebar = Gtk.SearchBar() 82 | box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) 83 | self.replacebar.add(box) 84 | self.replace_from = Gtk.Entry() 85 | box.pack_start(self.replace_from, False, False, 1) 86 | self.replace_to = Gtk.Entry() 87 | box.pack_start(self.replace_to, False, False, 1) 88 | self.replacebar.connect_entry(self.replace_from) 89 | grid.pack_start(self.replacebar, False, False, 0) 90 | self.replacebar.set_search_mode(False) 91 | self.replace_from.connect('activate', self.on_find) 92 | self.replace_to.connect('activate', self.on_replace) 93 | self.replace_from_text = '' 94 | self.replace_to_text = '' 95 | 96 | self.rubybar = Gtk.SearchBar() 97 | box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL) 98 | self.rubybar.add(box) 99 | label = Gtk.Label(_('Ruby') + ': ') 100 | box.pack_start(label, False, False, 1) 101 | self.ruby_entry = Gtk.Entry() 102 | box.pack_start(self.ruby_entry, False, False, 1) 103 | self.rubybar.connect_entry(self.ruby_entry) 104 | grid.pack_start(self.rubybar, False, False, 0) 105 | self.rubybar.set_search_mode(False) 106 | self.ruby_entry.connect('activate', self.on_ruby) 107 | 108 | self.statusbar = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL) 109 | self.line_col = Gtk.Label() 110 | self.statusbar.pack_end(self.line_col, False, False, 10) 111 | grid.pack_start(self.statusbar, False, False, 5) 112 | 113 | self.connect('key-press-event', self.on_key_press_event) 114 | 115 | actions = { 116 | 'new': self.new_callback, 117 | 'open': self.open_callback, 118 | 'save': self.save_callback, 119 | 'saveas': self.save_as_callback, 120 | 'close': self.close_callback, 121 | 'undo': self.undo_callback, 122 | 'redo': self.redo_callback, 123 | 'cut': self.cut_callback, 124 | 'copy': self.copy_callback, 125 | 'paste': self.paste_callback, 126 | 'find': self.find_callback, 127 | 'replace': self.replace_callback, 128 | 'annotate': self.annotate_callback, 129 | 'unconvert': self.unconvert_callback, 130 | 'selectall': self.select_all_callback, 131 | 'font': self.font_callback, 132 | 'help': self.help_callback, 133 | 'about': self.about_callback, 134 | } 135 | for name, method in actions.items(): 136 | action = Gio.SimpleAction.new(name, None) 137 | action.connect('activate', method) 138 | self.add_action(action) 139 | self.connect('delete-event', self.on_delete_event) 140 | 141 | action = Gio.SimpleAction.new_stateful( 142 | 'ruby', None, GLib.Variant.new_boolean(True)) 143 | action.connect('activate', self.ruby_callback) 144 | self.add_action(action) 145 | 146 | self.highlightlongsentences_action = Gio.SimpleAction.new_stateful( 147 | 'highlightlongsentences', None, GLib.Variant.new_boolean(True)) 148 | self.highlightlongsentences_action.connect( 149 | 'activate', self.highlightlongsentences_callback) 150 | self.add_action(self.highlightlongsentences_action) 151 | 152 | self.statusbar_action = Gio.SimpleAction.new_stateful( 153 | 'statusbar', None, GLib.Variant.new_boolean(True)) 154 | self.statusbar_action.connect( 155 | 'activate', self.statusbar_callback) 156 | self.add_action(self.statusbar_action) 157 | 158 | self.file = None 159 | self._load_file(file) 160 | self.update_statusbar() 161 | 162 | def _emit_to_focused(self, signal_name, *args): 163 | focused = self.get_focus() 164 | if focused: 165 | focused.emit(signal_name, *args) 166 | 167 | def _load_file(self, file): 168 | self.set_file(file) 169 | if file: 170 | try: 171 | success, content, etags = file.load_contents(None) 172 | content = content.decode('utf-8', 'ignore') 173 | content = remove_dangling_annotations(content) 174 | if content: 175 | self.buffer.begin_user_action() 176 | self.buffer.set_text(content) 177 | self.buffer.end_user_action() 178 | self.buffer.place_cursor(self.buffer.get_start_iter()) 179 | self.buffer.set_modified(False) 180 | except GLib.Error: 181 | LOGGER.exception(f'Could not read "{self.file.get_path()}"') 182 | # Create a new file 183 | self.save() 184 | self.update_title() 185 | 186 | def about_callback(self, action, parameter): 187 | dialog = Gtk.AboutDialog() 188 | dialog.set_transient_for(self) 189 | dialog.set_modal(True) 190 | dialog.set_program_name(self.title) 191 | dialog.set_copyright('Copyright 2019-2025 Esrille Inc.') 192 | dialog.set_authors(['Esrille Inc.']) 193 | dialog.set_documenters(['Esrille Inc.']) 194 | dialog.set_website('https://www.esrille.com/') 195 | dialog.set_website_label('Esrille Inc.') 196 | dialog.set_logo_icon_name('com.esrille.furiganapad') 197 | dialog.set_version(package.get_version()) 198 | # To close the dialog when "close" is clicked, e.g. on Raspberry Pi OS, 199 | # the "response" signal needs to be connected about_response_callback 200 | dialog.connect('response', self.about_response_callback) 201 | dialog.show() 202 | 203 | def about_response_callback(self, dialog, response): 204 | dialog.destroy() 205 | 206 | def add_filters(self, dialog): 207 | filter_text = Gtk.FileFilter() 208 | filter_text.set_name(_('Text files')) 209 | filter_text.add_mime_type('text/plain') 210 | dialog.add_filter(filter_text) 211 | 212 | filter_py = Gtk.FileFilter() 213 | filter_py.set_name(_('Python files')) 214 | filter_py.add_mime_type('text/x-python') 215 | dialog.add_filter(filter_py) 216 | 217 | filter_any = Gtk.FileFilter() 218 | filter_any.set_name(_('Any files')) 219 | filter_any.add_pattern('*') 220 | dialog.add_filter(filter_any) 221 | 222 | def annotate_callback(self, action, parameter): 223 | start, end = self.buffer.get_selection_bounds() 224 | if start != end and start.get_line() == end.get_line(): 225 | self.rubybar.set_search_mode(True) 226 | 227 | def close_callback(self, action, parameter): 228 | if not self.confirm_save_changes(): 229 | self.destroy() 230 | 231 | def confirm_save_changes(self): 232 | if not self.buffer.get_modified(): 233 | return False 234 | dialog = Gtk.MessageDialog( 235 | self, 0, Gtk.MessageType.QUESTION, 236 | Gtk.ButtonsType.NONE, _('Save changes to this document?')) 237 | dialog.format_secondary_text(_("If you don't, changes will be lost.")) 238 | dialog.add_button(_('Close _Without Saving'), Gtk.ResponseType.NO) 239 | dialog.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL) 240 | dialog.add_button(Gtk.STOCK_SAVE, Gtk.ResponseType.YES) 241 | dialog.set_default_response(Gtk.ResponseType.YES) 242 | response = dialog.run() 243 | dialog.destroy() 244 | if response == Gtk.ResponseType.NO: 245 | return False 246 | elif response == Gtk.ResponseType.YES: 247 | # Close the window after saving changes 248 | self.close_after_save = True 249 | if self.file is not None: 250 | return self.save() 251 | else: 252 | return self.save_as() 253 | else: 254 | return True 255 | 256 | def copy_callback(self, action, parameter): 257 | self._emit_to_focused('copy-clipboard') 258 | 259 | def cut_callback(self, action, parameter): 260 | self._emit_to_focused('cut-clipboard') 261 | 262 | def find_callback(self, action, parameter): 263 | start, end = self.buffer.get_selection_bounds() 264 | if start != end: 265 | self.search_entry_text = self.buffer.get_text(start, end, False).replace('\n', '') 266 | self.search_entry.set_text(self.search_entry_text) 267 | self.searchbar.set_search_mode(True) 268 | self.search_entry.grab_focus() 269 | 270 | def font_callback(self, action, parameter): 271 | dialog = Gtk.FontChooserDialog(_('Font'), self) 272 | dialog.props.preview_text = _('The quick brown fox jumps over the lazy dog.') 273 | font_desc = self.textview.get_font() 274 | dialog.set_font_desc(font_desc) 275 | response = dialog.run() 276 | if response == Gtk.ResponseType.OK: 277 | font = dialog.get_font() 278 | if font: 279 | desc = Pango.font_description_from_string(font) 280 | self.textview.set_font(desc) 281 | dialog.destroy() 282 | 283 | def get_file(self): 284 | return self.file 285 | 286 | def help_callback(self, action, parameter): 287 | # Use yelp to open local HTMLs. 288 | # cf. https://gitlab.gnome.org/GNOME/yelp/-/merge_requests/24 289 | path = os.path.join(package.get_datadir(), 'docs/index.html') 290 | subprocess.Popen(['yelp', path]) 291 | 292 | def highlightlongsentences_callback(self, action, parameter): 293 | highlight = not action.get_state() 294 | action.set_state(GLib.Variant.new_boolean(highlight)) 295 | self.textview.set_check_sentences(highlight) 296 | 297 | def new_callback(self, action, parameter): 298 | win = Window(self.get_application()) 299 | win.show_all() 300 | 301 | def on_delete_event(self, wid, event): 302 | return self.confirm_save_changes() 303 | 304 | def on_find(self, entry): 305 | self.select_text(get_plain_text(entry.get_text())) 306 | 307 | def on_key_press_event(self, wid, event): 308 | LOGGER.debug(f'on_key_press: {Gdk.keyval_name(event.keyval)}, {event.state:#08x}') 309 | # Control focus around search bars by checking keys typed into the 310 | # main window 311 | if self.search_entry.is_focus(): 312 | if event.keyval == Gdk.KEY_Escape: 313 | self.search_entry_text = self.search_entry.get_text() 314 | self.textview.grab_focus() 315 | return True 316 | elif self.replace_to.is_focus() or self.replace_from.is_focus(): 317 | if event.keyval == Gdk.KEY_Tab or event.keyval == Gdk.KEY_ISO_Left_Tab: 318 | if self.replace_to.is_focus(): 319 | self.replacebar.connect_entry(self.replace_from) 320 | self.replace_from.grab_focus() 321 | elif self.replace_from.is_focus(): 322 | self.replacebar.connect_entry(self.replace_to) 323 | self.replace_to.grab_focus() 324 | return True 325 | if event.keyval == Gdk.KEY_Escape: 326 | self.replace_from_text = self.replace_from.get_text() 327 | self.replace_to_text = self.replace_to.get_text() 328 | self.textview.grab_focus() 329 | return True 330 | return False 331 | 332 | def on_mark_set(self, buffer, where, mark): 333 | if mark.get_name() == 'insert': 334 | self.update_statusbar() 335 | 336 | def on_modified_changed(self, buffer): 337 | self.update_title() 338 | 339 | def on_replace(self, entry): 340 | text_from = get_plain_text(self.replace_from.get_text()) 341 | (start, end) = self.buffer.get_selection_bounds() 342 | if start != end: 343 | selection = self.buffer.get_text(start, end, False) 344 | if selection == text_from: 345 | text_to = self.replace_to.get_text() 346 | self.buffer.begin_user_action() 347 | self.buffer.delete(start, end) 348 | self.buffer.insert_at_cursor(text_to) 349 | self.buffer.end_user_action() 350 | cursor_mark = self.buffer.get_insert() 351 | self.textview.scroll_mark_onscreen(cursor_mark) 352 | self.select_text(text_from) 353 | 354 | def on_ruby(self, entry): 355 | start, end = self.buffer.get_selection_bounds() 356 | if start != end and start.get_line() == end.get_line(): 357 | text = self.buffer.get_text(start, end, False) 358 | ruby = get_plain_text(entry.get_text()) 359 | self.buffer.begin_user_action() 360 | self.buffer.delete(start, end) 361 | if ruby: 362 | text = IAA + text + IAS + ruby + IAT 363 | self.buffer.insert_at_cursor(text) 364 | self.buffer.end_user_action() 365 | self.textview.grab_focus() 366 | 367 | def on_textview_focus_in(self, wid, event): 368 | LOGGER.debug('on_textview_focus_in') 369 | self.set_action_sensitivity('selectall', True) 370 | self.searchbar.set_search_mode(False) 371 | self.replacebar.set_search_mode(False) 372 | self.rubybar.set_search_mode(False) 373 | 374 | def on_textview_focus_out(self, wid, event): 375 | LOGGER.debug('on_textview_focus_out') 376 | self.set_action_sensitivity('selectall', False) 377 | 378 | def open_callback(self, action, parameter): 379 | dialog = Gtk.FileChooserNative.new( 380 | _('Open File'), self, 381 | Gtk.FileChooserAction.OPEN, 382 | _('Open'), 383 | _('Cancel')) 384 | self.add_filters(dialog) 385 | dialog.set_modal(True) 386 | file = None 387 | response = dialog.run() 388 | if response == Gtk.ResponseType.ACCEPT: 389 | file = dialog.get_file() 390 | dialog.destroy() 391 | # Open new window after closing dialog to raise the new window 392 | # in the stacking order. 393 | if file: 394 | win = self.get_application().is_opened(file) 395 | if win: 396 | win.present() 397 | elif not self.buffer.empty(): 398 | win = Window(self.get_application(), file=file) 399 | win.show_all() 400 | else: 401 | self._load_file(file) 402 | 403 | def paste_callback(self, action, parameter): 404 | self._emit_to_focused('paste-clipboard') 405 | 406 | def redo_callback(self, action, parameter): 407 | self.textview.emit('redo') 408 | 409 | def replace_callback(self, action, parameter): 410 | start, end = self.buffer.get_selection_bounds() 411 | if start != end: 412 | self.replace_from_text = self.buffer.get_text(start, end, False).replace('\n', '') 413 | self.replace_from.set_text(self.replace_from_text) 414 | self.replace_to.set_text(self.replace_to_text) 415 | self.replacebar.set_search_mode(True) 416 | self.replace_from.grab_focus() 417 | 418 | def ruby_callback(self, action, parameter): 419 | ruby = not action.get_state() 420 | action.set_state(GLib.Variant.new_boolean(ruby)) 421 | self.buffer.set_ruby_mode(ruby) 422 | self.update_statusbar() 423 | 424 | def save(self): 425 | (start, end) = self.buffer.get_bounds() 426 | current_contents = self.buffer.get_text(start, end, True) 427 | try: 428 | if current_contents: 429 | current_contents += '\n' 430 | current_contents = current_contents.encode() 431 | self.file.replace_contents(current_contents, 432 | None, 433 | False, 434 | Gio.FileCreateFlags.NONE, 435 | None) 436 | else: 437 | self.file.replace_readwrite(None, 438 | False, 439 | Gio.FileCreateFlags.NONE, 440 | None) 441 | return self.set_file(self.file) 442 | except GLib.Error as e: 443 | dialog = Gtk.MessageDialog( 444 | self, 0, Gtk.MessageType.ERROR, 445 | Gtk.ButtonsType.OK, _('Could not save the file.')) 446 | dialog.format_secondary_text(e.message) 447 | dialog.run() 448 | dialog.destroy() 449 | self.save_as() 450 | return True 451 | 452 | def save_as(self): 453 | dialog = Gtk.FileChooserNative.new( 454 | _('Save File'), 455 | self, 456 | Gtk.FileChooserAction.SAVE, 457 | _('Save'), 458 | _('Cancel')) 459 | dialog.set_do_overwrite_confirmation(True) 460 | dialog.set_modal(True) 461 | if self.file is not None: 462 | try: 463 | dialog.set_file(self.file) 464 | except GLib.Error: 465 | LOGGER.exception(f'Could not create file "{self.file.get_path()}"') 466 | response = dialog.run() 467 | if response == Gtk.ResponseType.ACCEPT: 468 | self.file = dialog.get_file() 469 | LOGGER.debug(f'save_as: {self.file} "{dialog.get_current_folder()}"') 470 | dialog.destroy() 471 | result = self.save() 472 | self.update_title() 473 | return result 474 | dialog.destroy() 475 | return True 476 | 477 | def save_as_callback(self, action, parameter): 478 | self.save_as() 479 | 480 | def save_callback(self, action, parameter): 481 | if self.file is not None: 482 | self.save() 483 | else: 484 | self.save_as() 485 | 486 | def select_all_callback(self, action, parameter): 487 | self.textview.emit('select-all', True) 488 | 489 | def select_text(self, text): 490 | cursor_mark = self.buffer.get_insert() 491 | start = self.buffer.get_iter_at_mark(cursor_mark) 492 | selecton_mark = self.buffer.get_selection_bound() 493 | selected = self.buffer.get_iter_at_mark(selecton_mark) 494 | if start < selected: 495 | start = selected 496 | match = start.forward_search(text, 0, None) 497 | if match is None: 498 | start = self.buffer.get_start_iter() 499 | match = start.forward_search(text, 0, None) 500 | if match is not None: 501 | match_start, match_end = match 502 | self.buffer.select_range(match_start, match_end) 503 | self.textview.scroll_mark_onscreen(self.buffer.get_insert()) 504 | return match 505 | 506 | def set_action_sensitivity(self, action_name, state): 507 | self.lookup_action(action_name).set_enabled(state) 508 | 509 | def set_file(self, file): 510 | self.file = file 511 | return self.buffer.set_modified(not file) 512 | 513 | def statusbar_callback(self, action, parameter): 514 | visible = not action.get_state() 515 | action.set_state(GLib.Variant.new_boolean(visible)) 516 | self.statusbar.set_visible(visible) 517 | 518 | def unconvert_callback(self, action, parameter): 519 | self.buffer.begin_user_action() 520 | self.buffer.unconvert(self.buffer.get_cursor()) 521 | self.buffer.end_user_action() 522 | 523 | def undo_callback(self, action, parameter): 524 | self.textview.emit('undo') 525 | 526 | def update_statusbar(self): 527 | cursor = self.buffer.get_cursor() 528 | status = f'{cursor.get_line() + 1}:{cursor.get_plain_line_offset() + 1} ' 529 | if self.buffer.get_ruby_mode(): 530 | status += _('Ruby') 531 | else: 532 | status += '' + _('Ruby') + '' 533 | self.line_col.set_markup(status) 534 | 535 | def update_title(self): 536 | title = self.title 537 | if self.file: 538 | title = self.file.get_basename() + ' – ' + title 539 | if self.buffer.get_modified(): 540 | title = '*' + title 541 | self.set_title(title) 542 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 2.1, February 1999 3 | 4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | [This is the first released version of the Lesser GPL. It also counts 10 | as the successor of the GNU Library Public License, version 2, hence 11 | the version number 2.1.] 12 | 13 | Preamble 14 | 15 | The licenses for most software are designed to take away your 16 | freedom to share and change it. By contrast, the GNU General Public 17 | Licenses are intended to guarantee your freedom to share and change 18 | free software--to make sure the software is free for all its users. 19 | 20 | This license, the Lesser General Public License, applies to some 21 | specially designated software packages--typically libraries--of the 22 | Free Software Foundation and other authors who decide to use it. You 23 | can use it too, but we suggest you first think carefully about whether 24 | this license or the ordinary General Public License is the better 25 | strategy to use in any particular case, based on the explanations below. 26 | 27 | When we speak of free software, we are referring to freedom of use, 28 | not price. Our General Public Licenses are designed to make sure that 29 | you have the freedom to distribute copies of free software (and charge 30 | for this service if you wish); that you receive source code or can get 31 | it if you want it; that you can change the software and use pieces of 32 | it in new free programs; and that you are informed that you can do 33 | these things. 34 | 35 | To protect your rights, we need to make restrictions that forbid 36 | distributors to deny you these rights or to ask you to surrender these 37 | rights. These restrictions translate to certain responsibilities for 38 | you if you distribute copies of the library or if you modify it. 39 | 40 | For example, if you distribute copies of the library, whether gratis 41 | or for a fee, you must give the recipients all the rights that we gave 42 | you. You must make sure that they, too, receive or can get the source 43 | code. If you link other code with the library, you must provide 44 | complete object files to the recipients, so that they can relink them 45 | with the library after making changes to the library and recompiling 46 | it. And you must show them these terms so they know their rights. 47 | 48 | We protect your rights with a two-step method: (1) we copyright the 49 | library, and (2) we offer you this license, which gives you legal 50 | permission to copy, distribute and/or modify the library. 51 | 52 | To protect each distributor, we want to make it very clear that 53 | there is no warranty for the free library. Also, if the library is 54 | modified by someone else and passed on, the recipients should know 55 | that what they have is not the original version, so that the original 56 | author's reputation will not be affected by problems that might be 57 | introduced by others. 58 | 59 | Finally, software patents pose a constant threat to the existence of 60 | any free program. We wish to make sure that a company cannot 61 | effectively restrict the users of a free program by obtaining a 62 | restrictive license from a patent holder. Therefore, we insist that 63 | any patent license obtained for a version of the library must be 64 | consistent with the full freedom of use specified in this license. 65 | 66 | Most GNU software, including some libraries, is covered by the 67 | ordinary GNU General Public License. This license, the GNU Lesser 68 | General Public License, applies to certain designated libraries, and 69 | is quite different from the ordinary General Public License. We use 70 | this license for certain libraries in order to permit linking those 71 | libraries into non-free programs. 72 | 73 | When a program is linked with a library, whether statically or using 74 | a shared library, the combination of the two is legally speaking a 75 | combined work, a derivative of the original library. The ordinary 76 | General Public License therefore permits such linking only if the 77 | entire combination fits its criteria of freedom. The Lesser General 78 | Public License permits more lax criteria for linking other code with 79 | the library. 80 | 81 | We call this license the "Lesser" General Public License because it 82 | does Less to protect the user's freedom than the ordinary General 83 | Public License. It also provides other free software developers Less 84 | of an advantage over competing non-free programs. These disadvantages 85 | are the reason we use the ordinary General Public License for many 86 | libraries. However, the Lesser license provides advantages in certain 87 | special circumstances. 88 | 89 | For example, on rare occasions, there may be a special need to 90 | encourage the widest possible use of a certain library, so that it becomes 91 | a de-facto standard. To achieve this, non-free programs must be 92 | allowed to use the library. A more frequent case is that a free 93 | library does the same job as widely used non-free libraries. In this 94 | case, there is little to gain by limiting the free library to free 95 | software only, so we use the Lesser General Public License. 96 | 97 | In other cases, permission to use a particular library in non-free 98 | programs enables a greater number of people to use a large body of 99 | free software. For example, permission to use the GNU C Library in 100 | non-free programs enables many more people to use the whole GNU 101 | operating system, as well as its variant, the GNU/Linux operating 102 | system. 103 | 104 | Although the Lesser General Public License is Less protective of the 105 | users' freedom, it does ensure that the user of a program that is 106 | linked with the Library has the freedom and the wherewithal to run 107 | that program using a modified version of the Library. 108 | 109 | The precise terms and conditions for copying, distribution and 110 | modification follow. Pay close attention to the difference between a 111 | "work based on the library" and a "work that uses the library". The 112 | former contains code derived from the library, whereas the latter must 113 | be combined with the library in order to run. 114 | 115 | GNU LESSER GENERAL PUBLIC LICENSE 116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 117 | 118 | 0. This License Agreement applies to any software library or other 119 | program which contains a notice placed by the copyright holder or 120 | other authorized party saying it may be distributed under the terms of 121 | this Lesser General Public License (also called "this License"). 122 | Each licensee is addressed as "you". 123 | 124 | A "library" means a collection of software functions and/or data 125 | prepared so as to be conveniently linked with application programs 126 | (which use some of those functions and data) to form executables. 127 | 128 | The "Library", below, refers to any such software library or work 129 | which has been distributed under these terms. A "work based on the 130 | Library" means either the Library or any derivative work under 131 | copyright law: that is to say, a work containing the Library or a 132 | portion of it, either verbatim or with modifications and/or translated 133 | straightforwardly into another language. (Hereinafter, translation is 134 | included without limitation in the term "modification".) 135 | 136 | "Source code" for a work means the preferred form of the work for 137 | making modifications to it. For a library, complete source code means 138 | all the source code for all modules it contains, plus any associated 139 | interface definition files, plus the scripts used to control compilation 140 | and installation of the library. 141 | 142 | Activities other than copying, distribution and modification are not 143 | covered by this License; they are outside its scope. The act of 144 | running a program using the Library is not restricted, and output from 145 | such a program is covered only if its contents constitute a work based 146 | on the Library (independent of the use of the Library in a tool for 147 | writing it). Whether that is true depends on what the Library does 148 | and what the program that uses the Library does. 149 | 150 | 1. You may copy and distribute verbatim copies of the Library's 151 | complete source code as you receive it, in any medium, provided that 152 | you conspicuously and appropriately publish on each copy an 153 | appropriate copyright notice and disclaimer of warranty; keep intact 154 | all the notices that refer to this License and to the absence of any 155 | warranty; and distribute a copy of this License along with the 156 | Library. 157 | 158 | You may charge a fee for the physical act of transferring a copy, 159 | and you may at your option offer warranty protection in exchange for a 160 | fee. 161 | 162 | 2. You may modify your copy or copies of the Library or any portion 163 | of it, thus forming a work based on the Library, and copy and 164 | distribute such modifications or work under the terms of Section 1 165 | above, provided that you also meet all of these conditions: 166 | 167 | a) The modified work must itself be a software library. 168 | 169 | b) You must cause the files modified to carry prominent notices 170 | stating that you changed the files and the date of any change. 171 | 172 | c) You must cause the whole of the work to be licensed at no 173 | charge to all third parties under the terms of this License. 174 | 175 | d) If a facility in the modified Library refers to a function or a 176 | table of data to be supplied by an application program that uses 177 | the facility, other than as an argument passed when the facility 178 | is invoked, then you must make a good faith effort to ensure that, 179 | in the event an application does not supply such function or 180 | table, the facility still operates, and performs whatever part of 181 | its purpose remains meaningful. 182 | 183 | (For example, a function in a library to compute square roots has 184 | a purpose that is entirely well-defined independent of the 185 | application. Therefore, Subsection 2d requires that any 186 | application-supplied function or table used by this function must 187 | be optional: if the application does not supply it, the square 188 | root function must still compute square roots.) 189 | 190 | These requirements apply to the modified work as a whole. If 191 | identifiable sections of that work are not derived from the Library, 192 | and can be reasonably considered independent and separate works in 193 | themselves, then this License, and its terms, do not apply to those 194 | sections when you distribute them as separate works. But when you 195 | distribute the same sections as part of a whole which is a work based 196 | on the Library, the distribution of the whole must be on the terms of 197 | this License, whose permissions for other licensees extend to the 198 | entire whole, and thus to each and every part regardless of who wrote 199 | it. 200 | 201 | Thus, it is not the intent of this section to claim rights or contest 202 | your rights to work written entirely by you; rather, the intent is to 203 | exercise the right to control the distribution of derivative or 204 | collective works based on the Library. 205 | 206 | In addition, mere aggregation of another work not based on the Library 207 | with the Library (or with a work based on the Library) on a volume of 208 | a storage or distribution medium does not bring the other work under 209 | the scope of this License. 210 | 211 | 3. You may opt to apply the terms of the ordinary GNU General Public 212 | License instead of this License to a given copy of the Library. To do 213 | this, you must alter all the notices that refer to this License, so 214 | that they refer to the ordinary GNU General Public License, version 2, 215 | instead of to this License. (If a newer version than version 2 of the 216 | ordinary GNU General Public License has appeared, then you can specify 217 | that version instead if you wish.) Do not make any other change in 218 | these notices. 219 | 220 | Once this change is made in a given copy, it is irreversible for 221 | that copy, so the ordinary GNU General Public License applies to all 222 | subsequent copies and derivative works made from that copy. 223 | 224 | This option is useful when you wish to copy part of the code of 225 | the Library into a program that is not a library. 226 | 227 | 4. You may copy and distribute the Library (or a portion or 228 | derivative of it, under Section 2) in object code or executable form 229 | under the terms of Sections 1 and 2 above provided that you accompany 230 | it with the complete corresponding machine-readable source code, which 231 | must be distributed under the terms of Sections 1 and 2 above on a 232 | medium customarily used for software interchange. 233 | 234 | If distribution of object code is made by offering access to copy 235 | from a designated place, then offering equivalent access to copy the 236 | source code from the same place satisfies the requirement to 237 | distribute the source code, even though third parties are not 238 | compelled to copy the source along with the object code. 239 | 240 | 5. A program that contains no derivative of any portion of the 241 | Library, but is designed to work with the Library by being compiled or 242 | linked with it, is called a "work that uses the Library". Such a 243 | work, in isolation, is not a derivative work of the Library, and 244 | therefore falls outside the scope of this License. 245 | 246 | However, linking a "work that uses the Library" with the Library 247 | creates an executable that is a derivative of the Library (because it 248 | contains portions of the Library), rather than a "work that uses the 249 | library". The executable is therefore covered by this License. 250 | Section 6 states terms for distribution of such executables. 251 | 252 | When a "work that uses the Library" uses material from a header file 253 | that is part of the Library, the object code for the work may be a 254 | derivative work of the Library even though the source code is not. 255 | Whether this is true is especially significant if the work can be 256 | linked without the Library, or if the work is itself a library. The 257 | threshold for this to be true is not precisely defined by law. 258 | 259 | If such an object file uses only numerical parameters, data 260 | structure layouts and accessors, and small macros and small inline 261 | functions (ten lines or less in length), then the use of the object 262 | file is unrestricted, regardless of whether it is legally a derivative 263 | work. (Executables containing this object code plus portions of the 264 | Library will still fall under Section 6.) 265 | 266 | Otherwise, if the work is a derivative of the Library, you may 267 | distribute the object code for the work under the terms of Section 6. 268 | Any executables containing that work also fall under Section 6, 269 | whether or not they are linked directly with the Library itself. 270 | 271 | 6. As an exception to the Sections above, you may also combine or 272 | link a "work that uses the Library" with the Library to produce a 273 | work containing portions of the Library, and distribute that work 274 | under terms of your choice, provided that the terms permit 275 | modification of the work for the customer's own use and reverse 276 | engineering for debugging such modifications. 277 | 278 | You must give prominent notice with each copy of the work that the 279 | Library is used in it and that the Library and its use are covered by 280 | this License. You must supply a copy of this License. If the work 281 | during execution displays copyright notices, you must include the 282 | copyright notice for the Library among them, as well as a reference 283 | directing the user to the copy of this License. Also, you must do one 284 | of these things: 285 | 286 | a) Accompany the work with the complete corresponding 287 | machine-readable source code for the Library including whatever 288 | changes were used in the work (which must be distributed under 289 | Sections 1 and 2 above); and, if the work is an executable linked 290 | with the Library, with the complete machine-readable "work that 291 | uses the Library", as object code and/or source code, so that the 292 | user can modify the Library and then relink to produce a modified 293 | executable containing the modified Library. (It is understood 294 | that the user who changes the contents of definitions files in the 295 | Library will not necessarily be able to recompile the application 296 | to use the modified definitions.) 297 | 298 | b) Use a suitable shared library mechanism for linking with the 299 | Library. A suitable mechanism is one that (1) uses at run time a 300 | copy of the library already present on the user's computer system, 301 | rather than copying library functions into the executable, and (2) 302 | will operate properly with a modified version of the library, if 303 | the user installs one, as long as the modified version is 304 | interface-compatible with the version that the work was made with. 305 | 306 | c) Accompany the work with a written offer, valid for at 307 | least three years, to give the same user the materials 308 | specified in Subsection 6a, above, for a charge no more 309 | than the cost of performing this distribution. 310 | 311 | d) If distribution of the work is made by offering access to copy 312 | from a designated place, offer equivalent access to copy the above 313 | specified materials from the same place. 314 | 315 | e) Verify that the user has already received a copy of these 316 | materials or that you have already sent this user a copy. 317 | 318 | For an executable, the required form of the "work that uses the 319 | Library" must include any data and utility programs needed for 320 | reproducing the executable from it. However, as a special exception, 321 | the materials to be distributed need not include anything that is 322 | normally distributed (in either source or binary form) with the major 323 | components (compiler, kernel, and so on) of the operating system on 324 | which the executable runs, unless that component itself accompanies 325 | the executable. 326 | 327 | It may happen that this requirement contradicts the license 328 | restrictions of other proprietary libraries that do not normally 329 | accompany the operating system. Such a contradiction means you cannot 330 | use both them and the Library together in an executable that you 331 | distribute. 332 | 333 | 7. You may place library facilities that are a work based on the 334 | Library side-by-side in a single library together with other library 335 | facilities not covered by this License, and distribute such a combined 336 | library, provided that the separate distribution of the work based on 337 | the Library and of the other library facilities is otherwise 338 | permitted, and provided that you do these two things: 339 | 340 | a) Accompany the combined library with a copy of the same work 341 | based on the Library, uncombined with any other library 342 | facilities. This must be distributed under the terms of the 343 | Sections above. 344 | 345 | b) Give prominent notice with the combined library of the fact 346 | that part of it is a work based on the Library, and explaining 347 | where to find the accompanying uncombined form of the same work. 348 | 349 | 8. You may not copy, modify, sublicense, link with, or distribute 350 | the Library except as expressly provided under this License. Any 351 | attempt otherwise to copy, modify, sublicense, link with, or 352 | distribute the Library is void, and will automatically terminate your 353 | rights under this License. However, parties who have received copies, 354 | or rights, from you under this License will not have their licenses 355 | terminated so long as such parties remain in full compliance. 356 | 357 | 9. You are not required to accept this License, since you have not 358 | signed it. However, nothing else grants you permission to modify or 359 | distribute the Library or its derivative works. These actions are 360 | prohibited by law if you do not accept this License. Therefore, by 361 | modifying or distributing the Library (or any work based on the 362 | Library), you indicate your acceptance of this License to do so, and 363 | all its terms and conditions for copying, distributing or modifying 364 | the Library or works based on it. 365 | 366 | 10. Each time you redistribute the Library (or any work based on the 367 | Library), the recipient automatically receives a license from the 368 | original licensor to copy, distribute, link with or modify the Library 369 | subject to these terms and conditions. You may not impose any further 370 | restrictions on the recipients' exercise of the rights granted herein. 371 | You are not responsible for enforcing compliance by third parties with 372 | this License. 373 | 374 | 11. If, as a consequence of a court judgment or allegation of patent 375 | infringement or for any other reason (not limited to patent issues), 376 | conditions are imposed on you (whether by court order, agreement or 377 | otherwise) that contradict the conditions of this License, they do not 378 | excuse you from the conditions of this License. If you cannot 379 | distribute so as to satisfy simultaneously your obligations under this 380 | License and any other pertinent obligations, then as a consequence you 381 | may not distribute the Library at all. For example, if a patent 382 | license would not permit royalty-free redistribution of the Library by 383 | all those who receive copies directly or indirectly through you, then 384 | the only way you could satisfy both it and this License would be to 385 | refrain entirely from distribution of the Library. 386 | 387 | If any portion of this section is held invalid or unenforceable under any 388 | particular circumstance, the balance of the section is intended to apply, 389 | and the section as a whole is intended to apply in other circumstances. 390 | 391 | It is not the purpose of this section to induce you to infringe any 392 | patents or other property right claims or to contest validity of any 393 | such claims; this section has the sole purpose of protecting the 394 | integrity of the free software distribution system which is 395 | implemented by public license practices. Many people have made 396 | generous contributions to the wide range of software distributed 397 | through that system in reliance on consistent application of that 398 | system; it is up to the author/donor to decide if he or she is willing 399 | to distribute software through any other system and a licensee cannot 400 | impose that choice. 401 | 402 | This section is intended to make thoroughly clear what is believed to 403 | be a consequence of the rest of this License. 404 | 405 | 12. If the distribution and/or use of the Library is restricted in 406 | certain countries either by patents or by copyrighted interfaces, the 407 | original copyright holder who places the Library under this License may add 408 | an explicit geographical distribution limitation excluding those countries, 409 | so that distribution is permitted only in or among countries not thus 410 | excluded. In such case, this License incorporates the limitation as if 411 | written in the body of this License. 412 | 413 | 13. The Free Software Foundation may publish revised and/or new 414 | versions of the Lesser General Public License from time to time. 415 | Such new versions will be similar in spirit to the present version, 416 | but may differ in detail to address new problems or concerns. 417 | 418 | Each version is given a distinguishing version number. If the Library 419 | specifies a version number of this License which applies to it and 420 | "any later version", you have the option of following the terms and 421 | conditions either of that version or of any later version published by 422 | the Free Software Foundation. If the Library does not specify a 423 | license version number, you may choose any version ever published by 424 | the Free Software Foundation. 425 | 426 | 14. If you wish to incorporate parts of the Library into other free 427 | programs whose distribution conditions are incompatible with these, 428 | write to the author to ask for permission. For software which is 429 | copyrighted by the Free Software Foundation, write to the Free 430 | Software Foundation; we sometimes make exceptions for this. Our 431 | decision will be guided by the two goals of preserving the free status 432 | of all derivatives of our free software and of promoting the sharing 433 | and reuse of software generally. 434 | 435 | NO WARRANTY 436 | 437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 446 | 447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 456 | DAMAGES. 457 | 458 | END OF TERMS AND CONDITIONS 459 | 460 | How to Apply These Terms to Your New Libraries 461 | 462 | If you develop a new library, and you want it to be of the greatest 463 | possible use to the public, we recommend making it free software that 464 | everyone can redistribute and change. You can do so by permitting 465 | redistribution under these terms (or, alternatively, under the terms of the 466 | ordinary General Public License). 467 | 468 | To apply these terms, attach the following notices to the library. It is 469 | safest to attach them to the start of each source file to most effectively 470 | convey the exclusion of warranty; and each file should have at least the 471 | "copyright" line and a pointer to where the full notice is found. 472 | 473 | 474 | Copyright (C) 475 | 476 | This library is free software; you can redistribute it and/or 477 | modify it under the terms of the GNU Lesser General Public 478 | License as published by the Free Software Foundation; either 479 | version 2.1 of the License, or (at your option) any later version. 480 | 481 | This library is distributed in the hope that it will be useful, 482 | but WITHOUT ANY WARRANTY; without even the implied warranty of 483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 484 | Lesser General Public License for more details. 485 | 486 | You should have received a copy of the GNU Lesser General Public 487 | License along with this library; if not, write to the Free Software 488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 489 | 490 | Also add information on how to contact you by electronic and paper mail. 491 | 492 | You should also get your employer (if you work as a programmer) or your 493 | school, if any, to sign a "copyright disclaimer" for the library, if 494 | necessary. Here is a sample; alter the names: 495 | 496 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 497 | library `Frob' (a library for tweaking knobs) written by James Random Hacker. 498 | 499 | , 1 April 1990 500 | Ty Coon, President of Vice 501 | 502 | That's all there is to it! 503 | --------------------------------------------------------------------------------