unidoc / unipdf

Golang PDF library for creating and processing PDF files (pure go)
https://unidoc.io
Other
2.54k stars 250 forks source link

Add NewCompositePdfFontFromTTF to load composite TTF from memory #319

Closed gunnsth closed 4 years ago

gunnsth commented 4 years ago

Refactor the existing functionality to enable loading from stream rather than just file. More flexible.

Clarified documentation a bit and added a note regarding composite fonts to the simple TTF font loading functions NewPdfFontFromTTF.


This change is Reviewable

codecov[bot] commented 4 years ago

Codecov Report

Merging #319 into development will increase coverage by 4.08%. The diff coverage is 55.55%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development     #319      +/-   ##
===============================================
+ Coverage        52.28%   56.37%   +4.08%     
===============================================
  Files              235      235              
  Lines            45436    45443       +7     
===============================================
+ Hits             23758    25617    +1859     
+ Misses           18611    16524    -2087     
- Partials          3067     3302     +235     
Impacted Files Coverage Δ
model/font_simple.go 74.29% <ø> (+5.98%) :arrow_up:
model/font_composite.go 62.91% <55.55%> (+7.63%) :arrow_up:
internal/jbig2/document/segments/text-region.go 41.05% <0.00%> (+0.22%) :arrow_up:
...ernal/jbig2/document/segments/symbol-dictionary.go 38.49% <0.00%> (+0.23%) :arrow_up:
internal/jbig2/bitmap/bitmap.go 76.76% <0.00%> (+0.28%) :arrow_up:
model/writer.go 75.67% <0.00%> (+0.42%) :arrow_up:
internal/jbig2/document/segments/generic-region.go 47.75% <0.00%> (+1.18%) :arrow_up:
fdf/parser.go 40.27% <0.00%> (+1.38%) :arrow_up:
internal/jbig2/document/segments/kind.go 11.59% <0.00%> (+1.44%) :arrow_up:
model/reader.go 46.41% <0.00%> (+1.67%) :arrow_up:
... and 48 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 11f3a6e...fa5f135. Read the comment docs.