Custom fonts for Japanese

This commit is contained in:
Alex Yatskov 2016-05-09 19:07:39 -07:00
parent 64bdc7ea5e
commit 8438a1fe32
5 changed files with 25 additions and 14 deletions

View File

@ -10,9 +10,11 @@ templates['footer.html'] = template({"compiler":[7,">= 4.0.0"],"main":function(c
templates['header.html'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { templates['header.html'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
var helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; var helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
return "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <title></title>\n <style>\n @font-face {\n font-family: \"KanjiStrokeOrders\";\n src: url(\"" return "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <title></title>\n <style>\n @font-face {\n font-family: kanji-stroke-orders;\n src: url('"
+ alias4(((helper = (helper = helpers.root || (depth0 != null ? depth0.root : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"root","hash":{},"data":data}) : helper))) + alias4(((helper = (helper = helpers.root || (depth0 != null ? depth0.root : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"root","hash":{},"data":data}) : helper)))
+ "/ttf/kanji-stroke-orders.ttf\");\n }\n </style>\n <link rel=\"stylesheet\" href=\"" + "/ttf/kanji-stroke-orders.ttf');\n }\n @font-face {\n font-family: vl-gothic-regular;\n src: url('"
+ alias4(((helper = (helper = helpers.root || (depth0 != null ? depth0.root : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"root","hash":{},"data":data}) : helper)))
+ "/ttf/vl-gothic-regular.ttf');\n }\n </style>\n <link rel=\"stylesheet\" href=\""
+ alias4(((helper = (helper = helpers.root || (depth0 != null ? depth0.root : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"root","hash":{},"data":data}) : helper))) + alias4(((helper = (helper = helpers.root || (depth0 != null ? depth0.root : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"root","hash":{},"data":data}) : helper)))
+ "/css/frame.css\">\n </head>\n <body>\n"; + "/css/frame.css\">\n </head>\n <body>\n";
},"useData":true}); },"useData":true});
@ -48,13 +50,13 @@ templates['kanji.html'] = template({"1":function(container,depth0,helpers,partia
},"8":function(container,depth0,helpers,partials,data) { },"8":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
return " <dt>Kunyomi</dt>\n <dd>\n" return " <dt>Kunyomi</dt>\n <dd class=\"kanji-reading\">\n"
+ ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.kunyomi : depth0),{"name":"each","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.kunyomi : depth0),{"name":"each","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " </dd>\n"; + " </dd>\n";
},"10":function(container,depth0,helpers,partials,data) { },"10":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
return " <dt>Onyomi</dt>\n <dd>\n" return " <dt>Onyomi</dt>\n <dd class=\"kanji-reading\">\n"
+ ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.onyomi : depth0),{"name":"each","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.onyomi : depth0),{"name":"each","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " </dd>\n"; + " </dd>\n";
},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data,blockParams,depths) { },"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data,blockParams,depths) {

View File

@ -82,7 +82,7 @@ body {
.term-expression { .term-expression {
display: inline-block; display: inline-block;
font-family: serif; font-family: vl-gothic-regular;
font-size: 24px; font-size: 24px;
} }
@ -113,13 +113,17 @@ body {
.kanji-glyph { .kanji-glyph {
float: left; float: left;
font-family: 'KanjiStrokeOrders'; font-family: kanji-stroke-orders;
font-size: 140px; font-size: 140px;
line-height: 140px; line-height: 140px;
padding: 0.01em; padding: 0.01em;
vertical-align: top; vertical-align: top;
} }
.kanji-reading {
font-family: vl-gothic-regular;
}
.kanji-info { .kanji-info {
display: block; display: block;
overflow: hidden; overflow: hidden;

View File

@ -23,11 +23,12 @@
"web_accessible_resources": [ "web_accessible_resources": [
"fg/css/frame.css", "fg/css/frame.css",
"fg/img/add_expression.png",
"fg/img/add_kanji.png",
"fg/img/add_reading.png",
"fg/js/frame.js", "fg/js/frame.js",
"fg/ttf/kanji-stroke-orders.ttf", "fg/ttf/kanji-stroke-orders.ttf",
"fg/img/add_expression.png", "fg/ttf/vl-gothic-regular.ttf"
"fg/img/add_reading.png",
"fg/img/add_kanji.png"
], ],
"content_scripts": [{ "content_scripts": [{

View File

@ -5,8 +5,12 @@
<title></title> <title></title>
<style> <style>
@font-face { @font-face {
font-family: "KanjiStrokeOrders"; font-family: kanji-stroke-orders;
src: url("{{root}}/ttf/kanji-stroke-orders.ttf"); src: url('{{root}}/ttf/kanji-stroke-orders.ttf');
}
@font-face {
font-family: vl-gothic-regular;
src: url('{{root}}/ttf/vl-gothic-regular.ttf');
} }
</style> </style>
<link rel="stylesheet" href="{{root}}/css/frame.css"> <link rel="stylesheet" href="{{root}}/css/frame.css">

View File

@ -22,7 +22,7 @@
{{#if kunyomi}} {{#if kunyomi}}
<dt>Kunyomi</dt> <dt>Kunyomi</dt>
<dd> <dd class="kanji-reading">
{{#each kunyomi}} {{#each kunyomi}}
{{.}}{{#unless @last}}, {{/unless}} {{.}}{{#unless @last}}, {{/unless}}
{{/each}} {{/each}}
@ -31,7 +31,7 @@
{{#if onyomi}} {{#if onyomi}}
<dt>Onyomi</dt> <dt>Onyomi</dt>
<dd> <dd class="kanji-reading">
{{#each onyomi}} {{#each onyomi}}
{{.}}{{#unless @last}}, {{/unless}} {{.}}{{#unless @last}}, {{/unless}}
{{/each}} {{/each}}