Skip to content

Commit

Permalink
add dune rules for copying fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
dm0n3y committed Aug 31, 2024
1 parent fe4496a commit 0f7a4e1
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 46 deletions.
File renamed without changes.
File renamed without changes.
42 changes: 3 additions & 39 deletions src/web/style.css
Original file line number Diff line number Diff line change
@@ -1,61 +1,25 @@
@font-face {
font-family: 'Fira Code';
font-style: normal;
font-weight: normal;
src: url('fonts/FiraCode-Regular.woff2') format('woff2');
}

@font-face {
font-family: 'Fira Code';
font-style: normal;
font-weight: bold;
src: url('fonts/FiraCode-Bold.woff2') format('woff2');
}

@font-face {
font-family: 'Karla';
font-style: normal;
font-weight: normal;
src: url(https://fonts.gstatic.com/s/karla/v14/qkBIXvYC6trAT55ZBi1ueQVIjQTD-JqaE0lK.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
font-family: 'Helvetica Neue';
font-style: normal;
font-weight: normal;
src: url('fonts/HelveticaNeue-Regular.woff2') format('woff2');
}

@font-face {
font-family: 'Helvetica Neue';
font-style: normal;
font-weight: bold;
src: url('fonts/HelveticaNeue-Bold.woff2') format('woff2');
}

@font-face{
font-family: 'Source Code Pro';
font-weight: normal;
font-style: normal;
font-stretch: normal;
src: url('fonts/SourceCodePro-Regular.otf.woff2') format('woff2');
src: url('SourceCodePro-Regular.otf.woff2') format('woff2');
}

@font-face{
font-family: 'Source Code Pro';
font-weight: bold;
font-style: normal;
font-stretch: normal;
src: url('fonts/SourceCodePro-Bold.otf.woff2') format('woff2');
src: url('SourceCodePro-Bold.otf.woff2') format('woff2');
}

@font-face{
font-family: 'Source Code Pro';
font-weight: 900;
font-style: normal;
font-stretch: normal;
src: url('fonts/SourceCodePro-Black.otf.woff2') format('woff2');
src: url('SourceCodePro-Black.otf.woff2') format('woff2');
}

:root {
Expand Down
14 changes: 7 additions & 7 deletions src/web/view/Code.re
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ let cursor = (~font, z: Zipper.t) =>
};

let view = (~font: Model.Font.t, ~zipper: Zipper.t): Node.t => {
print_endline("--- Code.view ---");
print_endline("z = " ++ Zipper.show(zipper));
// print_endline("--- Code.view ---");
// print_endline("z = " ++ Zipper.show(zipper));
let c = Zipper.zip(~save_cursor=true, zipper);
print_endline("c = " ++ Cell.show(c));
let t = Layout.Tree.of_cell(c);
print_endline("t = " ++ Layout.Tree.show(t));
let b = Layout.Tree.flatten(t);
print_endline("b = " ++ Layout.Block.show(b));
// print_endline("c = " ++ Cell.show(c));
// let t = Layout.Tree.of_cell(c);
// print_endline("t = " ++ Layout.Tree.show(t));
// let b = Layout.Tree.flatten(t);
// print_endline("b = " ++ Layout.Block.show(b));
div(
~attrs=[Attr.class_("code"), Attr.id("under-the-rail")],
[view_text(c), ...cursor(~font, zipper)] @ carets(~font, c),
Expand Down
11 changes: 11 additions & 0 deletions src/web/www/dune
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,14 @@

(rule
(copy ../style.css style.css))

(rule
(copy ../fonts/SourceCodePro-Black.otf.woff2 SourceCodePro-Black.otf.woff2))

(rule
(copy ../fonts/SourceCodePro-Bold.otf.woff2 SourceCodePro-Bold.otf.woff2))

(rule
(copy
../fonts/SourceCodePro-Regular.otf.woff2
SourceCodePro-Regular.otf.woff2))
Binary file removed src/web/www/fonts/FiraCode-Bold.woff2
Binary file not shown.
Binary file removed src/web/www/fonts/FiraCode-Regular.woff2
Binary file not shown.
Binary file removed src/web/www/fonts/HelveticaNeue-Bold.woff2
Binary file not shown.
Binary file removed src/web/www/fonts/HelveticaNeue-Regular.woff2
Binary file not shown.

0 comments on commit 0f7a4e1

Please sign in to comment.