glyphic 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/LICENSE.txt +1 -1
- data/README.md +22 -11
- data/Rakefile +1 -1
- data/docs/index.html +31 -0
- data/lib/glyphic/version.rb +1 -1
- metadata +14 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 738496f374c2a619ecfe954d756b61e8c9acd315f58fe987bf9ea0a8ea74780d
|
|
4
|
+
data.tar.gz: e6930b83fabcc8ece85a292d3730f1b41aa32506facd362afbd9b8bc97679e9c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 141454631eac879ceeb67733f6a690d4dbdcd1381412121bb9337d003d3a475745f7c3198781be499de3e3734291655509627d1db9d9f0b9748e0ea6d17d2f97
|
|
7
|
+
data.tar.gz: fd9853fa5bfdf46d2b5beb67758ee0eebaa90e109c7c4907cb505bcd7b1786ca35c8d43f88992207be6d2f1af27c2a54d903fee0145cbe1d3e3b78965edcd291
|
data/CHANGELOG.md
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">Glyphic</h1>
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[](https://rubygems.org/gems/glyphic)
|
|
5
|
-
[](https://github.com/rbgfx/glyphic/actions/workflows/ci.yml)
|
|
6
|
-
[](https://www.ruby-lang.org/)
|
|
7
|
-
[](LICENSE.txt)
|
|
3
|
+
<p align="center">Bitmap and outline font rendering for Ruby graphics.</p>
|
|
8
4
|
|
|
9
|
-
>
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://rubygems.org/gems/glyphic"><img src="https://badge.fury.io/rb/glyphic.svg" alt="Gem Version"></a>
|
|
7
|
+
<a href="https://rubygems.org/gems/glyphic"><img src="https://img.shields.io/gem/dt/glyphic?label=downloads" alt="Downloads"></a>
|
|
8
|
+
<a href="https://www.ruby-lang.org/"><img src="https://img.shields.io/badge/ruby-%3E%3D3.1-CC342D?logo=ruby&logoColor=white" alt="Ruby Version"></a>
|
|
9
|
+
<a href="LICENSE.txt"><img src="https://img.shields.io/badge/license-MIT-750014.svg" alt="License"></a>
|
|
10
|
+
</p>
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
draws it onto Tessel RGBA8 images.
|
|
12
|
+
[Features](#features) · [Installation](#installation) · [Quick Start](#quick-start)
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
***
|
|
15
|
+
|
|
16
|
+
Glyphic loads BDF bitmap fonts and TrueType outlines, measures UTF-8 text, and draws it onto Tessel RGBA8 images.
|
|
15
17
|
|
|
16
18
|
## Features
|
|
17
19
|
|
|
@@ -42,7 +44,12 @@ Or install the released gem:
|
|
|
42
44
|
gem install glyphic
|
|
43
45
|
~~~
|
|
44
46
|
|
|
45
|
-
|
|
47
|
+
### Requirements
|
|
48
|
+
|
|
49
|
+
- Ruby 3.1 or newer.
|
|
50
|
+
- Tessel is installed automatically as a runtime dependency.
|
|
51
|
+
|
|
52
|
+
## Quick Start
|
|
46
53
|
|
|
47
54
|
~~~ruby
|
|
48
55
|
require "glyphic"
|
|
@@ -64,6 +71,10 @@ bundle install
|
|
|
64
71
|
bundle exec rake verify
|
|
65
72
|
~~~
|
|
66
73
|
|
|
74
|
+
## Contributing
|
|
75
|
+
|
|
76
|
+
Bug reports and pull requests are welcome at [rbgfx/glyphic](https://github.com/rbgfx/glyphic).
|
|
77
|
+
|
|
67
78
|
## License
|
|
68
79
|
|
|
69
80
|
[MIT](LICENSE.txt)
|
data/Rakefile
CHANGED
data/docs/index.html
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en"><head>
|
|
3
|
+
<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
|
|
4
|
+
<meta name="theme-color" content="#020617"><meta name="description" content="Load BDF bitmap fonts and TrueType outlines, measure UTF-8 text, and draw into Tessel images.">
|
|
5
|
+
<meta property="og:title" content="Glyphic — Give every glyph a place."><meta property="og:description" content="Load BDF bitmap fonts and TrueType outlines, measure UTF-8 text, and draw into Tessel images."><meta property="og:type" content="website"><meta property="og:url" content="https://rbgfx.github.io/glyphic/">
|
|
6
|
+
<meta name="twitter:card" content="summary"><link rel="canonical" href="https://rbgfx.github.io/glyphic/"><title>Glyphic — Give every glyph a place.</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root{color-scheme:dark;--bg:#020617;--panel:#0f172a;--line:#334155;--ink:#e2e8f0;--muted:#94a3b8;--a:#38bdf8;--mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--sans:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;--w:min(100% - 2.5rem,76rem)}
|
|
9
|
+
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.65 var(--sans)}a{color:inherit;text-underline-offset:.22em}a:hover{color:var(--a)}a:focus-visible{outline:3px solid var(--a);outline-offset:4px}h1,h2,h3,p,figure,pre{margin:0}h1,h2,h3{line-height:1.08;text-wrap:balance}p{text-wrap:pretty}code,pre,.mono{font-family:var(--mono);font-variant-numeric:tabular-nums}.wrap{width:var(--w);margin:auto}.skip{position:fixed;left:1rem;top:1rem;z-index:1;transform:translateY(-160%);padding:.7rem 1rem;background:var(--ink);color:var(--bg)}.skip:focus{transform:none}
|
|
10
|
+
header{height:4.75rem;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between}.brand{display:flex;align-items:center;gap:.7rem;font-weight:750;text-decoration:none}.mark{width:2rem;height:2rem;display:grid;place-items:center;border:1px solid var(--a);color:var(--a);font:.85rem var(--mono)}nav{display:flex;gap:1.5rem;font-size:.9rem}nav a{text-decoration:none;color:var(--muted)}nav a:last-child{color:var(--ink)}
|
|
11
|
+
.hero{display:grid;grid-template-columns:.88fr 1.12fr;align-items:center;gap:clamp(2rem,6vw,6rem);padding-block:clamp(4rem,9vw,8rem)}.kicker,.visual figcaption,.num{font:.76rem/1.4 var(--mono);color:var(--a)}h1{max-width:11ch;margin-top:1rem;font-size:clamp(3rem,7.5vw,6.5rem);letter-spacing:-.065em}.lede{max-width:40rem;margin-top:1.5rem;color:var(--muted);font-size:1.15rem}.actions{display:flex;flex-wrap:wrap;gap:.8rem;margin-top:2rem}.button{min-height:2.8rem;padding:.65rem 1rem;border:1px solid var(--line);display:inline-flex;align-items:center;text-decoration:none;font-weight:650}.button.primary{background:var(--a);border-color:var(--a);color:var(--bg)}.install{margin-top:1.4rem;color:var(--muted);font:.86rem var(--mono)}.install code{color:var(--ink)}
|
|
12
|
+
.visual{border:1px solid var(--line);background:var(--panel)}.art{min-height:18rem;padding:1.25rem;display:grid;place-items:center;overflow:hidden}.art svg{width:100%;max-height:23rem}.visual figcaption{display:flex;justify-content:space-between;gap:1rem;padding:.75rem 1rem;border-top:1px solid var(--line);color:var(--muted)}.visual figcaption span:last-child{color:var(--a)}
|
|
13
|
+
section.info{padding-block:4.5rem;border-top:1px solid var(--line)}.section-head{display:grid;grid-template-columns:.72fr 1.28fr;gap:2rem;align-items:end;margin-bottom:2rem}h2{font-size:clamp(2rem,4vw,3.25rem);letter-spacing:-.045em}.section-head p,.feature p,.try-copy p{color:var(--muted)}.features{display:grid;grid-template-columns:repeat(3,1fr);border-top:1px solid var(--line)}.feature{padding:1.25rem 1.2rem 1.4rem 0;border-bottom:1px solid var(--line)}.feature+.feature{padding-left:1.2rem;border-left:1px solid var(--line)}.feature h3{margin-top:.8rem;font-size:1.1rem}.feature p{margin-top:.5rem;font-size:.94rem}.try{display:grid;grid-template-columns:.75fr 1.25fr;align-items:center;gap:clamp(2rem,7vw,7rem)}.try-copy p{margin-top:1rem}.try-copy a{color:var(--ink)}pre{overflow-x:auto;padding:1.25rem;border:1px solid var(--line);background:var(--panel);font-size:.82rem;line-height:1.8;tab-size:2}
|
|
14
|
+
footer{display:flex;justify-content:space-between;gap:1rem;padding-block:1.6rem;border-top:1px solid var(--line);color:var(--muted);font-size:.85rem}footer div{display:flex;gap:1.25rem}
|
|
15
|
+
@media(max-width:800px){.hero{grid-template-columns:1fr;gap:2.5rem}.hero-copy{max-width:42rem}.section-head,.try{grid-template-columns:1fr;gap:1rem}}@media(max-width:560px){:root{--w:min(100% - 1.5rem,76rem)}header{height:4.2rem}nav{gap:.8rem;font-size:.8rem}nav a:first-child{display:none}h1{font-size:clamp(3rem,15vw,5rem)}.features{grid-template-columns:1fr}.feature,.feature+.feature{padding:1.1rem 0;border-left:0}.num{display:inline-block}footer{flex-direction:column}.art{min-height:14rem}section.info{padding-block:3.5rem}pre{font-size:.75rem;padding:1rem}}
|
|
16
|
+
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
|
|
17
|
+
|
|
18
|
+
</style>
|
|
19
|
+
</head><body style="--a:#fbbf24"><a class="skip" href="#main">Skip to content</a><div class="wrap">
|
|
20
|
+
<header><a class="brand" href="#top" aria-label="Glyphic home"><span class="mark" aria-hidden="true">G</span><span>Glyphic</span></a><nav aria-label="Primary navigation"><a href="#features">Overview</a><a href="#quick-start">Quick start</a><a href="https://github.com/rbgfx/glyphic">Source ↗</a></nav></header>
|
|
21
|
+
<main id="main"><section class="hero" id="top" aria-labelledby="title"><div class="hero-copy"><p class="kicker">Font loading · measuring · rasterizing</p><h1 id="title">Give every glyph a place.</h1><p class="lede">Load BDF bitmap fonts and TrueType outlines, measure UTF-8 text, and draw into Tessel images.</p><div class="actions"><a class="button primary" href="#quick-start">Get started</a><a class="button" href="https://rubygems.org/gems/glyphic">RubyGems ↗</a></div><p class="install"><span aria-hidden="true">$</span> <code>gem install glyphic</code></p></div>
|
|
22
|
+
<figure class="visual" aria-labelledby="cap-glyphic"><div class="art"><svg viewBox="0 0 640 360" aria-hidden="true"><rect width="640" height="360" fill="#0b1224"/><path d="M32 95H608M32 274H608M32 298H608" stroke="#334155"/><text x="38" y="260" fill="#fbbf24" font-family="Georgia,serif" font-size="220" letter-spacing="-15">Ag</text><text x="38" y="72" fill="#94a3b8" font-family="monospace" font-size="13">CAP HEIGHT</text><text x="38" y="326" fill="#94a3b8" font-family="monospace" font-size="13">BASELINE</text></svg></div><figcaption id="cap-glyphic"><span>Font specimen</span><span>baseline / cap height</span></figcaption></figure></section>
|
|
23
|
+
<section class="info" id="features" aria-labelledby="feat"><div class="section-head"><h2 id="feat">From font data to a measured line.</h2><p>Keep text layout and drawing close to the Ruby graphics code that uses it.</p></div><div class="features"><article class="feature"><span class="num">01</span><h3>Load font formats</h3><p>Read BDF bitmap fonts or rasterize TrueType outlines.</p></article><article class="feature"><span class="num">02</span><h3>Measure text</h3><p>Wrap UTF-8 strings and lay out text boxes.</p></article><article class="feature"><span class="num">03</span><h3>Resolve missing glyphs</h3><p>Configure fallbacks and use the built-in example font.</p></article></div></section>
|
|
24
|
+
<section class="info try" id="quick-start" aria-labelledby="quick"><div class="try-copy"><p class="kicker">A small first step</p><h2 id="quick">Start with one example.</h2><p>Install the gem, then follow the project guide for platform requirements and the full API.</p><p><a href="https://github.com/rbgfx/glyphic#installation">Read the installation guide ↗</a></p></div><pre><code>require "glyphic"
|
|
25
|
+
require "tessel"
|
|
26
|
+
|
|
27
|
+
font = Glyphic.default
|
|
28
|
+
image = Tessel::Image.new(320, 112, fill: "#101827")
|
|
29
|
+
font.draw(image, 12, 12, "Glyphic", color: "#fbbf24")
|
|
30
|
+
image.write("type.png")</code></pre></section></main>
|
|
31
|
+
<footer><span>Glyphic · Ruby 3.1+ · MIT</span><div><a href="https://github.com/rbgfx/glyphic">GitHub</a><a href="https://github.com/rbgfx/glyphic/blob/main/LICENSE.txt">License</a></div></footer></div></body></html>
|
data/lib/glyphic/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: glyphic
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
-
|
|
7
|
+
- Yudai Takada
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: exe
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-09-25 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: tessel
|
|
@@ -16,6 +17,9 @@ dependencies:
|
|
|
16
17
|
- - ">="
|
|
17
18
|
- !ruby/object:Gem::Version
|
|
18
19
|
version: 0.1.0
|
|
20
|
+
- - "<"
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: '1'
|
|
19
23
|
type: :runtime
|
|
20
24
|
prerelease: false
|
|
21
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -23,6 +27,9 @@ dependencies:
|
|
|
23
27
|
- - ">="
|
|
24
28
|
- !ruby/object:Gem::Version
|
|
25
29
|
version: 0.1.0
|
|
30
|
+
- - "<"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '1'
|
|
26
33
|
description: BDF text rendering and layout on Tessel RGBA8 images.
|
|
27
34
|
email:
|
|
28
35
|
- t.yudai92@gmail.com
|
|
@@ -34,6 +41,7 @@ files:
|
|
|
34
41
|
- LICENSE.txt
|
|
35
42
|
- README.md
|
|
36
43
|
- Rakefile
|
|
44
|
+
- docs/index.html
|
|
37
45
|
- lib/glyphic.rb
|
|
38
46
|
- lib/glyphic/version.rb
|
|
39
47
|
- sig/glyphic.rbs
|
|
@@ -43,6 +51,7 @@ licenses:
|
|
|
43
51
|
metadata:
|
|
44
52
|
homepage_uri: https://github.com/rbgfx/glyphic
|
|
45
53
|
source_code_uri: https://github.com/rbgfx/glyphic/tree/main
|
|
54
|
+
post_install_message:
|
|
46
55
|
rdoc_options: []
|
|
47
56
|
require_paths:
|
|
48
57
|
- lib
|
|
@@ -57,7 +66,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
57
66
|
- !ruby/object:Gem::Version
|
|
58
67
|
version: '0'
|
|
59
68
|
requirements: []
|
|
60
|
-
rubygems_version: 4.
|
|
69
|
+
rubygems_version: 3.4.19
|
|
70
|
+
signing_key:
|
|
61
71
|
specification_version: 4
|
|
62
72
|
summary: Bitmap and outline font rendering for Ruby graphics
|
|
63
73
|
test_files: []
|