-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #384 from DSW-PS/open-dev-v1
useFont/addFont with PDFontSupplier (FSSupplier<PDFont>)
- Loading branch information
Showing
3 changed files
with
86 additions
and
19 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
openhtmltopdf-pdfbox/src/main/java/com/openhtmltopdf/pdfboxout/PDFontSupplier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.openhtmltopdf.pdfboxout; | ||
|
||
import org.apache.pdfbox.pdmodel.font.PDFont; | ||
|
||
import com.openhtmltopdf.extend.FSSupplier; | ||
|
||
/** | ||
* Implementation of {@link FSSupplier} that supplies a {@link PDFont}.<br> | ||
* Subclass this if you need special font loading rules (like using a font-cache, ...). | ||
*/ | ||
public class PDFontSupplier implements FSSupplier<PDFont> { | ||
|
||
// this used to be a private static class in PdfBoxFontResolver | ||
private PDFont _font; | ||
|
||
public PDFontSupplier(PDFont font) { | ||
this._font = font; | ||
} | ||
|
||
@Override | ||
public PDFont supply() { | ||
return _font; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters