Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/VERSION_11_5_1' into VERSION_11_5_1
Browse files Browse the repository at this point in the history
  • Loading branch information
plutext committed Nov 29, 2024
2 parents c9751c9 + f248547 commit fcc5e67
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public PhysicalFont extract(String fontNameAsInTablePart, String fontFileName, S
boolean simulateStyle = false;
boolean embedAsType1 = false;

FontUris fontUris = new FontUris(new URI("file:" + path), null);
FontUris fontUris = new FontUris(getF().toURI(), null);

customFont = FontLoader.loadFont(fontUris,
subFontName, embedded, EmbeddingMode.AUTO, EncodingMode.AUTO,
Expand All @@ -159,20 +159,22 @@ public PhysicalFont extract(String fontNameAsInTablePart, String fontFileName, S
}

// Get this font as a PhysicalFont object; do NOT add it to physical fonts (since those are available to all documents)
try {
List<PhysicalFont> fonts = PhysicalFonts.getPhysicalFont(fontNameAsInTablePart, new URI("file:" + path));
// try {


List<PhysicalFont> fonts = PhysicalFonts.getPhysicalFont(fontNameAsInTablePart, getF().toURI());
return (fonts == null || fonts.isEmpty()) ? null : fonts.iterator().next();


// This needs to be done before populateFontMappings,
// otherwise this font will be ignored, and references
// to it mapped to some substitute font!

} catch (URISyntaxException e) {
// } catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
// e.printStackTrace();
// }
// return null;

}

Expand Down

0 comments on commit fcc5e67

Please sign in to comment.