From ef72a8b12ab0dfa67103ef6b99d7cacd86b1494a Mon Sep 17 00:00:00 2001 From: "Matteo Franci a.k.a. Fugerit" Date: Mon, 5 Feb 2024 23:00:03 +0100 Subject: [PATCH] default font name/style/size documentation --- docs/html/doc_meta_info.html | 54 +++++++++++++++++++ .../typehelper/generic/GenericConsts.java | 15 ++++++ .../docs/meta_xml/adm_standard_meta_info.xml | 33 ++++++++++++ .../ext/helpers/OpenPpfDocHandler.java | 11 ++-- 4 files changed, 106 insertions(+), 7 deletions(-) diff --git a/docs/html/doc_meta_info.html b/docs/html/doc_meta_info.html index 64aff669a..ba68f12ee 100644 --- a/docs/html/doc_meta_info.html +++ b/docs/html/doc_meta_info.html @@ -230,6 +230,60 @@

Properties for generic metadata

3.2.2

+ + + + +

default-font-name

+ + +

Set the default font name

+ + +

fj-doc-mod-fop(pdf), fj-doc-mod-openpdf-ext(pdf), fj-doc-mod-openrtf-ext(rtf),

+ + +

helvetica

+ + +

1.4.5

+ + + + + +

default-font-size

+ + +

Set the default font size

+ + +

fj-doc-mod-fop(pdf), fj-doc-mod-openpdf-ext(pdf), fj-doc-mod-openrtf-ext(rtf),

+ + +

10

+ + +

1.4.5

+ + + + + +

default-font-style

+ + +

Set the default font style

+ + +

fj-doc-mod-fop(pdf), fj-doc-mod-openpdf-ext(pdf), fj-doc-mod-openrtf-ext(rtf),

+ + +

normal

+ + +

1.4.5

+ diff --git a/fj-doc-base/src/main/java/org/fugerit/java/doc/base/typehelper/generic/GenericConsts.java b/fj-doc-base/src/main/java/org/fugerit/java/doc/base/typehelper/generic/GenericConsts.java index 43ff448a5..9b8cdffd5 100644 --- a/fj-doc-base/src/main/java/org/fugerit/java/doc/base/typehelper/generic/GenericConsts.java +++ b/fj-doc-base/src/main/java/org/fugerit/java/doc/base/typehelper/generic/GenericConsts.java @@ -178,7 +178,22 @@ private GenericConsts() {} */ public static final String TABLE_BORDER_COLLAPSE_COLLAPSE = "collapse"; + /** + * See 'default-font-name' documentation. + */ + public static final String DOC_DEFAULT_FONT_NAME = "default-font-name"; + + /** + * See 'default-font-size' documentation. + */ + public static final String DOC_DEFAULT_FONT_SIZE = "default-font-size"; + + + /** + * See 'default-font-style' documentation. + */ + public static final String DOC_DEFAULT_FONT_STYLE = "default-font-style"; } diff --git a/fj-doc-lib-autodoc/src/test/resources/docs/meta_xml/adm_standard_meta_info.xml b/fj-doc-lib-autodoc/src/test/resources/docs/meta_xml/adm_standard_meta_info.xml index bc7a5c8c4..b45896320 100644 --- a/fj-doc-lib-autodoc/src/test/resources/docs/meta_xml/adm_standard_meta_info.xml +++ b/fj-doc-lib-autodoc/src/test/resources/docs/meta_xml/adm_standard_meta_info.xml @@ -156,6 +156,39 @@ pdf fj-doc-mod-fop(pdf) + + default-font-name + Set the default font name + helvetica + 1.4.5 + pdf + rtf + fj-doc-mod-fop(pdf) + fj-doc-mod-openpdf-ext(pdf) + fj-doc-mod-openrtf-ext(rtf) + + + default-font-size + Set the default font size + 10 + 1.4.5 + pdf + rtf + fj-doc-mod-fop(pdf) + fj-doc-mod-openpdf-ext(pdf) + fj-doc-mod-openrtf-ext(rtf) + + + default-font-style + Set the default font style + normal + 1.4.5 + pdf + rtf + fj-doc-mod-fop(pdf) + fj-doc-mod-openpdf-ext(pdf) + fj-doc-mod-openrtf-ext(rtf) + diff --git a/fj-doc-mod-openpdf-ext/src/main/java/org/fugerit/java/doc/mod/openpdf/ext/helpers/OpenPpfDocHandler.java b/fj-doc-mod-openpdf-ext/src/main/java/org/fugerit/java/doc/mod/openpdf/ext/helpers/OpenPpfDocHandler.java index 908afdcea..0a983d28c 100644 --- a/fj-doc-mod-openpdf-ext/src/main/java/org/fugerit/java/doc/mod/openpdf/ext/helpers/OpenPpfDocHandler.java +++ b/fj-doc-mod-openpdf-ext/src/main/java/org/fugerit/java/doc/mod/openpdf/ext/helpers/OpenPpfDocHandler.java @@ -27,6 +27,7 @@ import org.fugerit.java.doc.base.model.DocPhrase; import org.fugerit.java.doc.base.model.DocStyle; import org.fugerit.java.doc.base.model.DocTable; +import org.fugerit.java.doc.base.typehelper.generic.GenericConsts; import org.fugerit.java.doc.base.xml.DocModelUtils; import com.lowagie.text.Anchor; @@ -98,10 +99,6 @@ protected static void setStyle( DocStyle parent, DocStyle current ) { private String docType; public static final String MODULE = "openpdf-ext"; - - public static final String DOC_DEFAULT_FONT_NAME = "default-font-name"; - public static final String DOC_DEFAULT_FONT_SIZE = "default-font-size"; - public static final String DOC_DEFAULT_FONT_STYLE = "default-font-style"; private int totalPageCount; @@ -319,9 +316,9 @@ private void handleFooter( DocBase docBase, PdfHelper pdfHelper, OpenPdfHelper d public void handleDoc(DocBase docBase) throws DocumentException, IOException { Properties info = docBase.getInfo(); - String defaultFontName = info.getProperty( DOC_DEFAULT_FONT_NAME, "helvetica" ); - String defaultFontSize = info.getProperty( DOC_DEFAULT_FONT_SIZE, "10" ); - String defaultFontStyle = info.getProperty( DOC_DEFAULT_FONT_STYLE, "normal" ); + String defaultFontName = info.getProperty( GenericConsts.DOC_DEFAULT_FONT_NAME, "helvetica" ); + String defaultFontSize = info.getProperty( GenericConsts.DOC_DEFAULT_FONT_SIZE, "10" ); + String defaultFontStyle = info.getProperty( GenericConsts.DOC_DEFAULT_FONT_STYLE, "normal" ); OpenPdfHelper docHelper = new OpenPdfHelper(); if ( this.pdfWriter != null ) {