Skip to content

No fallback_fonts support? #80

@luiges90

Description

@luiges90

It seems that fallback_fonts are unsupported in tables. That means if I want to put text of multiple languages in one table while having suitable font for each languages I am out of luck 😞

pdf = Prawn::Document.new
pdf.font_families["zh"] = {
  :normal => { :file => "#{data_path}/bsmi00lp.ttf", :font => "zh" }
}
pdf.fallback_fonts ['Helvetica', 'zh']

table = [
  ['', '總覽SUMMARY', ''],
  ['...', '東西something', '...']
]

pdf.table(table, width: pdf.bounds.width, cell_style: {fallback_fonts: ['Helvetica', 'zh']})

Gives me this error

Your document includes text that''s not compatible with the Windows-1252 character set.
If you need full UTF-8 support, use TTF fonts instead of PDF''s built-in fonts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions