|
|
|
@ -55,27 +55,25 @@ class WorkPackage::PDFExport::View |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def fallback_fonts |
|
|
|
|
[] |
|
|
|
|
[noto_font_base_path.join('NotoSansSymbols2-Regular.ttf')] |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def register_fonts!(document) |
|
|
|
|
font_path = Rails.public_path.join('fonts') |
|
|
|
|
|
|
|
|
|
document.font_families['NotoSans'] = { |
|
|
|
|
normal: { |
|
|
|
|
file: font_path.join('noto/NotoSans-Regular.ttf'), |
|
|
|
|
file: noto_font_base_path.join('NotoSans-Regular.ttf'), |
|
|
|
|
font: 'NotoSans-Regular' |
|
|
|
|
}, |
|
|
|
|
italic: { |
|
|
|
|
file: font_path.join('noto/NotoSans-Italic.ttf'), |
|
|
|
|
file: noto_font_base_path.join('NotoSans-Italic.ttf'), |
|
|
|
|
font: 'NotoSans-Italic' |
|
|
|
|
}, |
|
|
|
|
bold: { |
|
|
|
|
file: font_path.join('noto/NotoSans-Bold.ttf'), |
|
|
|
|
file: noto_font_base_path.join('NotoSans-Bold.ttf'), |
|
|
|
|
font: 'NotoSans-Bold' |
|
|
|
|
}, |
|
|
|
|
bold_italic: { |
|
|
|
|
file: font_path.join('noto/NotoSans-BoldItalic.ttf'), |
|
|
|
|
file: noto_font_base_path.join('NotoSans-BoldItalic.ttf'), |
|
|
|
|
font: 'NotoSans-BoldItalic' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -99,4 +97,10 @@ class WorkPackage::PDFExport::View |
|
|
|
|
|
|
|
|
|
document.font |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
private |
|
|
|
|
|
|
|
|
|
def noto_font_base_path |
|
|
|
|
Rails.public_path.join('fonts/noto') |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|