All Projects → Gedevan-Aleksizde → fontregisterer

Gedevan-Aleksizde / fontregisterer

Licence: MIT license
Cross-platform auto font registerer for R grapics/Rでグラフ描くためのフォント自動登録パッケージ (クロスプラットフォーム)

Programming Languages

r
7636 projects
CSS
56736 projects

Projects that are alternatives of or similar to fontregisterer

Genki Study Resources
A collection of exercises for practicing what is taught in Genki: An Integrated Course in Elementary Japanese.
Stars: ✭ 232 (+1557.14%)
Mutual labels:  japanese-language
Nihonoari-App
A little and minimalist Japanese Kana training
Stars: ✭ 66 (+371.43%)
Mutual labels:  japanese-language
limelight
A php Japanese language text analyzer and parser.
Stars: ✭ 76 (+442.86%)
Mutual labels:  japanese-language
jmdict-simplified
JMdict, JMnedict, Kanjidic, KRADFILE/RADKFILE in JSON format
Stars: ✭ 96 (+585.71%)
Mutual labels:  japanese-language
AtCoderClans
【非公式】AtCoderがもっと楽しくなるリンク集です。有志による非公式サービス・ツール・ライブラリ・記事などをまとめています。
Stars: ✭ 74 (+428.57%)
Mutual labels:  japanese-language
kotoba
A Discord bot for helping with learning Japanese.
Stars: ✭ 118 (+742.86%)
Mutual labels:  japanese-language
Rikaikun
Translate Japanese by hovering over words.
Stars: ✭ 200 (+1328.57%)
Mutual labels:  japanese-language
Onion Rime Files
電腦 Rime 洋蔥方案(注音、雙拼、拼音、形碼、行列30)
Stars: ✭ 88 (+528.57%)
Mutual labels:  japanese-language
jaco-js
Japanese character optimizer for JavaScript
Stars: ✭ 72 (+414.29%)
Mutual labels:  japanese-language
Domino-English-Translation
🌏 Let's translate Domino, a Japanese MIDI editor!
Stars: ✭ 29 (+107.14%)
Mutual labels:  japanese-language
nippon
日语N5-N2语法笔记~ 🍻
Stars: ✭ 84 (+500%)
Mutual labels:  japanese-language
workshop-IJTA
Rによる日本語テキスト分析入門
Stars: ✭ 25 (+78.57%)
Mutual labels:  japanese-language
ra-language-japanese
Japanese messages for react-admin
Stars: ✭ 22 (+57.14%)
Mutual labels:  japanese-language
python-doc-ja
Python ドキュメント日本語訳プロジェクト
Stars: ✭ 130 (+828.57%)
Mutual labels:  japanese-language
jrte-corpus
Japanese Realistic Textual Entailment Corpus (NLP 2020, LREC 2020)
Stars: ✭ 66 (+371.43%)
Mutual labels:  japanese-language
Mecab Ipadic Neologd
Neologism dictionary based on the language resources on the Web for mecab-ipadic
Stars: ✭ 2,408 (+17100%)
Mutual labels:  japanese-language
google-news-scraper
Google News Scraper for languages like Japanese, Chinese... [VPN Support]
Stars: ✭ 88 (+528.57%)
Mutual labels:  japanese-language
Hibi
[No Active Development] An Android app for learning Japanese by keeping a journal.
Stars: ✭ 37 (+164.29%)
Mutual labels:  japanese-language
BallBall-Words
🙇背单词(日语英语)的微信小程序
Stars: ✭ 76 (+442.86%)
Mutual labels:  japanese-language
kanji-frequency
Kanji usage frequency data collected from various sources
Stars: ✭ 92 (+557.14%)
Mutual labels:  japanese-language

Cross-platform Automatic Font Registerer For R Graphics

全てのシステムフォントをRグラフィックスに登録するだけのパッケージ (クロスプラットフォーム)

お使いのOSがLINUXの場合は不要です

You don’t have to use this package if your operating system is LINUX

Installation

run the following command in R

remotes::install_github("Gedevan-Aleksizde/fontregisterer", upgrade = "never")

This package depends on systemfonts.

Usage

This package registers all of your system fonts automatically when loaded. this procedure is executed by widowsFonts() (when Windows OS) or quartzFonts() (when Mac OS).

library(fontregisterer)

You can also reload by executing register_all_fonts().

You can check the list of loaded fonts by windowsFonts() or quartzFonts(), or systemfonts::system_fonts()$family if LINUX.

You can specify font family name to charts drawn by both graphics and ggplot2 based packages.

ALL YOUR FONT ARE BELONG TO YOU…

インストール方法

: まずこちらを一読してこのパッケージが必要かどうか判断したほうが良いかもしれません: https://ill-identified.hatenablog.com/entry/2021/09/10/231230

R で以下を実行してください

remotes::install_github("Gedevan-Aleksizde/fontregisterer", repos = NULL, type = "source")

このパッケージは systemfonts に依存しています.

使い方

library(fontregisterer)

で読み込んだ時点で作動します. Windows なら windowsFonts(), Mac なら quartzFonts() を使用してシステムフォントを全て登録します. やり直したかったら register_all_fonts() を実行してください (例えば使用中に新しくフォントをインストールしたなどの場合).

登録されたフォントファミリを確認したい場合は windowsFonts() または quartzFonts() を実行してください. LINUX の場合は systemfonts::system_fonts()$family で確認できます.

登録されたフォントファミリ名は標準グラフィックにも ggplot2 にも指定可能です. png(), quartz() デバイスでの保存時にも文字化けしません.

例えば, Windows (8以降) ならば "Yu Mincho" (游明朝), Yu Gothic (游ゴシック) などを, Mac なら "Hiragino Mincho ProN" (ヒラギノ明朝ProN), "Hiragino Sans" (ヒラギノ角ゴシック) などを指定可能です.

グラフのフォント指定は例えば標準グラフィックスなら

par(family = "Yu Gothic")
plot(0, 0)
text(0, 0, "日本語表示で広がるRの世界")

ggplot2 なら

require(ggplot2)
ggplot(data.frame(x = 0), aes(x = 0, y = 0, label = "日本語表示で広がるRの世界")) +
  geom_point(family = "Yu Gothic") +
  labs(x = "X軸ラベル", y = "Y軸ラベル", title = "タイトル") +
  theme(text = element_text(family = "Yu Gothic"))
  • v0.3 以降, フォントのサンプルを表示するRStudioアドインを追加しています. Addins -> “Font Selector” を選択してください.

addin Linux

addin Windows

このパッケージの意義や用途全般の話は詳しくは以下を参考にしてください.

https://ill-identified.hatenablog.com/entry/2020/10/03/200618

Japan.R 2020 で紹介しました.

https://speakerdeck.com/ktgrstsh/display-cjk-font-in-any-gpraphic-device-and-platform-2020

2021年9月時点での最新の情報

https://ill-identified.hatenablog.com/entry/2021/09/10/231230

ALL YOUR FONT ARE BELONG TO YOU…

既知の問題

特に Windows OS において, いくつかのフォント・グラフィックデバイスの組み合わせ時にフォントが認識されないことがあります. これは主に Windows OS では fontconfig ライブラリが使えず, systemfonts (v1.0.1 現在) パッケージやグラフィックデバイスでフォント検出の独自実装をせざるを得ないのが原因です. また本パッケージがなくとも ragg でフォント選択はできますが, 同じく systemfonts に依存しているため一部のフォントが使用できません. 依存パッケージの問題のため, fontregisterer では解決が難しいです.

例:

  1. BIZ UDフォントシリーズ Windows 10にプリインストールされているものはウェイトが500のため, Windows では標準ウェイトのフォントとしてマッチングできず, 使用できないことがあります. Linux や Mac などではおそらく正常に動作します.
  2. イタリック体を持たないフォント (多くの日本語フォント) イタリック体と斜体 (スラント体) は厳密には異なります. 日本語でイタリック体を指定してもうまく表示されないことが多いです.
  3. フォントファミリ名にスペースを含むもの svglite でうまくフォント名を認識できないことがあります. SVG ファイルはテキスト形式なので手動で引用符で囲むなどして修正することができます.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].