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