Skip to content

Commit

Permalink
m n o
Browse files Browse the repository at this point in the history
  • Loading branch information
nclslbrn committed May 6, 2024
1 parent bf141fe commit 7dd3c54
Show file tree
Hide file tree
Showing 6 changed files with 204 additions and 39 deletions.
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div id="app"></div>
<footer>
<p>
<a href="https://github.com/nclslbrn/plotWritter"> PlotWritter </a>
<a href="https://github.com/nclslbrn/plotWritter"> PlotWriter </a>
MIT License
</p>
</footer>
Expand Down
20 changes: 11 additions & 9 deletions demo/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@ console.log(
),
);
*/
/*

const rotateGlyph = (g: Glyph) =>
g.map((l: Line) => l.map((p: Vec) => [1 - p[0], 1 - p[1]]));
const upscaleGlyph = (g: Glyph) =>
g.map((l: Line) => l.map((p: Vec) => [p[0] * 1.1 - 0.05, p[1] * 1.1 - 0.05]));

const scaleGlyph = (g: Glyph) =>
g.map((l: Line) => l.map((p: Vec) => [0.166 + p[0] * 0.66, 0.166 + p[1] * 0.66]));
const mirrorXGlyph = (g: Glyph) =>
g.map((l: Line) => l.map((p: Vec) => [p[0], 1 - p[1]]));
const mirrorYGlyph = (g: Glyph) =>
g.map((l: Line) => l.map((p: Vec) => [p[0], 1 - p[1]]));
const mirrorXGlyph = (g: Glyph) =>
g.map((l: Line) => l.map((p: Vec) => [1 - p[0], p[1]]));

// font["ɜ"] = mirrorYGlyph(font["ɛ"])
console.log(JSON.stringify(scaleGlyph(font["L"])));
*/
// alert(`ɴ: ${JSON.stringify(scaleGlyph(font["N"]))},`);

for (let l = 0; l < lowercase.length; l++) {
if (font[lowercase[l]] === undefined) {
console.log(`%c ${lowercase[l]}`, "font-size: 3em");
Expand Down Expand Up @@ -83,7 +83,7 @@ const update = () => {
Math.min(Math.floor(Math.hypot(width, height) * fontScale), 264),
),
textSize = [baseSize, baseSize],
charPerLine = Math.floor(width / textSize[0]) - 2,
charPerLine = Math.floor(width / textSize[0]),
nbLines = Math.ceil(text.length / charPerLine),
margin = [(width - charPerLine * textSize[0]) / 2, 40];
group.textContent = "";
Expand Down Expand Up @@ -138,13 +138,15 @@ const init = () => {

input.innerText = textAtLaunch;
input.addEventListener("change", update);

inputSize.type = "range";
inputSize.min = "0.05";
inputSize.value = "0.17";
inputSize.max = "0.2";
inputSize.step = "0.01";
inputSize.addEventListener("change", update);
inputSize.value = "0.12";
inputSize.addEventListener("change", (e) => {
console.log((e.target as HTMLInputElement).value);
update();
});

form.appendChild(input);
form.appendChild(inputSize);
Expand Down
31 changes: 17 additions & 14 deletions src/glyphs/diacritics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ const diacritics = {
dr: [
[
[0.4, 0.1],
[0.4, 0.15],
[0.4, 0.125],
],
[
[0.6, 0.1],
[0.6, 0.15],
[0.6, 0.125],
],
],
// tild
Expand Down Expand Up @@ -157,21 +157,15 @@ const diacritics = {
// ring/dot below
db: [
[
[0.5, 0.75],
[0.55, 0.8],
[0.5, 0.85],
[0.45, 0.8],
[0.5, 0.75],
[0.5, 0.8],
[0.5, 0.825]
],
],
// dot above
da: [
[
[0.5, 0.05],
[0.55, 0.1],
[0.5, 0.15],
[0.45, 0.1],
[0.5, 0.05],
[0.5, 0.1],
[0.5, 0.125]
],
],
// hook above
Expand All @@ -187,9 +181,9 @@ const diacritics = {
// hook bottom right
hbr: [
[
[0.85, 0.725],
[0.85, 0.7],
[0.85, 0.85],
[0.9, 0.9]
[0.75, 0.9]
]
],
// line below
Expand Down Expand Up @@ -229,6 +223,15 @@ const diacritics = {
[0.75, 0.75],
[0.85, 0.8]
]
],
// ogonek middle
gnkc: [
[
[0.5, 0.7],
[0.475, 0.75],
[0.5, 0.79],
[0.55, 0.8]
]
]
} as Font;

Expand Down
130 changes: 120 additions & 10 deletions src/glyphs/lowercase/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ const base = {
],
ƌ: [
[
[0.15, 0.15],
[0.15, 0.15],
[0.85, 0.725],
],
Expand Down Expand Up @@ -722,7 +721,7 @@ const base = {
i: [
[
[0.5, 0.1],
[0.5, 0.15],
[0.5, 0.125],
],
[
[0.15, 0.3],
Expand All @@ -738,7 +737,7 @@ const base = {
ij: [
[
[0.35, 0.1],
[0.35, 0.15],
[0.35, 0.125],
],
[
[0.15, 0.3],
Expand All @@ -752,7 +751,7 @@ const base = {
],
[
[0.65, 0.1],
[0.65, 0.15],
[0.65, 0.125],
],
[
[0.5, 0.3],
Expand Down Expand Up @@ -793,7 +792,7 @@ const base = {
ɨ: [
[
[0.5, 0.1],
[0.5, 0.15],
[0.5, 0.125],
],
[
[0.15, 0.3],
Expand Down Expand Up @@ -823,7 +822,7 @@ const base = {
j: [
[
[0.6, 0.1],
[0.6, 0.15],
[0.6, 0.125],
],
[
[0.15, 0.3],
Expand All @@ -849,7 +848,7 @@ const base = {
ɉ: [
[
[0.6, 0.1],
[0.6, 0.15],
[0.6, 0.125],
],
[
[0.15, 0.3],
Expand All @@ -868,7 +867,7 @@ const base = {
ʝ: [
[
[0.6, 0.1],
[0.6, 0.15],
[0.6, 0.125],
],
[
[0.15, 0.3],
Expand Down Expand Up @@ -1002,7 +1001,7 @@ const base = {

[
[0.65, 0.1],
[0.65, 0.15],
[0.65, 0.125],
],
[
[0.5, 0.3],
Expand Down Expand Up @@ -1153,8 +1152,34 @@ const base = {
[0.5, 0.8],
],
],
ƛ: [
[
[0.3, 0.15],
[0.5, 0.2],
[0.85, 0.7],
],
[
[0.62, 0.4],
[0.15, 0.7],
],
[
[0.48, 0.35],
[0.65, 0.25],
],
],
ʎ: [
[
[0.7, 0.15],
[0.5, 0.2],
[0.15, 0.7],
],
[
[0.38, 0.4],
[0.85, 0.7],
],
],

m: [
m: [
[
[0.15, 0.7],
[0.15, 0.275],
Expand All @@ -1169,6 +1194,7 @@ const base = {
[0.5, 0.7],
],
],

n: [
[
[0.15, 0.7],
Expand All @@ -1180,6 +1206,90 @@ const base = {
[0.85, 0.7],
],
],
nj: [
[
[0.15, 0.7],
[0.15, 0.275],
],
[
[0.15, 0.3],
[0.45, 0.3],
[0.45, 0.7],
],
[
[0.7, 0.1],
[0.7, 0.125],
],
[
[0.55, 0.3],
[0.85, 0.3],
],
[
[0.7, 0.3],
[0.7, 0.9],
[0.45, 0.9],
],
],
ɴ: [
[
[0.265, 0.628],
[0.265, 0.3],
[0.73, 0.628],
[0.73, 0.3],
],
],
ɲ: [
[
[0.1, 0.77],
[0.125, 0.75],
[0.15, 0.7],
[0.15, 0.275],
],
[
[0.15, 0.3],
[0.85, 0.3],
[0.85, 0.7],
],
],
ƞ: [
[
[0.15, 0.7],
[0.15, 0.275],
],
[
[0.15, 0.3],
[0.85, 0.3],
[0.85, 0.9],
],
],
ɳ: [
[
[0.15, 0.7],
[0.15, 0.275],
],
[
[0.15, 0.3],
[0.77, 0.3],
[0.77, 0.85],
[0.85, 0.9]
],
],
ȵ: [
[
[0.15, 0.7],
[0.15, 0.275],
],
[
[0.15, 0.3],
[0.65, 0.3],
[0.65, 0.9],
[0.85, 0.9],
[0.85, 0.7],
[0.5, 0.9]
],

],

o: [
[
[0.15, 0.7],
Expand Down
Loading

0 comments on commit 7dd3c54

Please sign in to comment.