Author: jleroux Date: Tue Apr 21 08:03:41 2015 New Revision: 1675061 URL: http://svn.apache.org/r1675061 Log: This defines the NotoSans font as default for report and FOP-PDF examples With NotoSans by default, no need to specify the NotoSans "font-family" to write special characters in examples PDF (including content called from example). This already worked in reports because of "fop.font.family=NotoSans" in fop.properties. It's also the way to use for custom reports.
I also added <auto-embed/> like we have <auto-detect/> but I'm unsure of what it does exactly (I suppose it embeds the fonts glyphs in the PDF) because the FOP documentation is unclear about it (to say the least). If someone knows better please chime in! Modified: ofbiz/trunk/applications/content/webapp/content/fonts.fo.ftl ofbiz/trunk/applications/content/widget/CommonScreens.xml ofbiz/trunk/framework/common/widget/CommonScreens.xml ofbiz/trunk/framework/webapp/config/fop.xconf ofbiz/trunk/specialpurpose/example/widget/example/FormWidgetExampleScreens.xml Modified: ofbiz/trunk/applications/content/webapp/content/fonts.fo.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/fonts.fo.ftl?rev=1675061&r1=1675060&r2=1675061&view=diff ============================================================================== --- ofbiz/trunk/applications/content/webapp/content/fonts.fo.ftl (original) +++ ofbiz/trunk/applications/content/webapp/content/fonts.fo.ftl Tue Apr 21 08:03:41 2015 @@ -17,7 +17,10 @@ specific language governing permissions under the License. --> <#escape x as x?xml> -<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" + <#-- inheritance --> + <#if defaultFontFamily?has_content>font-family="${defaultFontFamily}"</#if> +> <!-- defines the layout master --> <fo:layout-master-set> @@ -39,7 +42,6 @@ under the License. <fo:flow flow-name="xsl-region-body"> - <fo:block font-family="Helvetica" font-size="14pt"> Helvetica </fo:block> @@ -300,7 +302,7 @@ Helvetica </fo:table> </fo:block> - <fo:block font-family="Helvetica" font-size="14pt"> + <fo:block font-family="Helvetica" font-size="14pt"> Times Roman </fo:block> <fo:block space-after.optimum="10pt" font-family="Times Roman" font-size="10pt"> @@ -560,7 +562,7 @@ Times Roman </fo:table> </fo:block> - <fo:block font-family="Helvetica" font-size="14pt"> + <fo:block font-family="Helvetica" font-size="14pt"> Courier </fo:block> <fo:block space-after.optimum="10pt" font-family="Courier" font-size="10pt"> @@ -820,7 +822,7 @@ Courier </fo:table> </fo:block> - <fo:block font-family="Helvetica" font-size="14pt"> + <fo:block font-family="Helvetica" font-size="14pt"> ZapfDingbats: </fo:block> <fo:block space-after.optimum="10pt" font-family="ZapfDingbats" font-size="10pt"> @@ -1068,7 +1070,7 @@ Courier </fo:table> </fo:block> - <fo:block font-family="Helvetica" font-size="14pt"> + <fo:block font-family="Helvetica" font-size="14pt"> Symbol: </fo:block> <fo:block space-after.optimum="10pt" font-family="Symbol" font-size="10pt"> @@ -1304,7 +1306,7 @@ Courier </fo:block> - <fo:block font-family="Helvetica" font-size="14pt"> + <fo:block font-family="Helvetica" font-size="14pt"> NotoSans </fo:block> <fo:block space-after.optimum="10pt" font-family="NotoSans" font-size="10pt"> @@ -1569,18 +1571,21 @@ NotoSans <fo:block font-family="Helvetica" font-size="12pt"> Some special characters: </fo:block> - <fo:block font-family="Helvetica" font-size="12pt"> + <fo:block font-family="Helvetica" font-size="12pt"> Euro symbol in Helvetica 12 ( dec 8364, hex 20AC): € </fo:block> - <fo:block font-family="NotoSans" font-size="12pt"> + <fo:block font-family="NotoSans" font-size="12pt"> Ruppe symbol in NotoSans 12 (dec 8377, hex 20B9): ₹ </fo:block> - <fo:block font-family="NotoSans" font-size="12pt"> + <fo:block font-family="NotoSans" font-size="12pt"> 0 °C = 32 °F :) </fo:block> - <fo:block font-family="NotoSans" font-size="12pt"> + <fo:block font-family="NotoSans" font-size="12pt"> I ♥ NotoSans! </fo:block> + <fo:block font-size="12pt"> +We now use the NotoSans font by default, so no need to specify the NotoSans "font-family" to write special characters, like: € ₹ ° ♥ + </fo:block> </fo:flow> </fo:page-sequence> Modified: ofbiz/trunk/applications/content/widget/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/widget/CommonScreens.xml?rev=1675061&r1=1675060&r2=1675061&view=diff ============================================================================== --- ofbiz/trunk/applications/content/widget/CommonScreens.xml (original) +++ ofbiz/trunk/applications/content/widget/CommonScreens.xml Tue Apr 21 08:03:41 2015 @@ -446,6 +446,9 @@ under the License. </screen> <screen name="fonts.fo"> <section> + <actions> + <property-to-field resource="fop.properties" field="defaultFontFamily" property="fop.font.family" default="NotoSans" /> + </actions> <widgets> <platform-specific> <xsl-fo><html-template location="component://content/webapp/content/fonts.fo.ftl"/></xsl-fo> Modified: ofbiz/trunk/framework/common/widget/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonScreens.xml?rev=1675061&r1=1675060&r2=1675061&view=diff ============================================================================== --- ofbiz/trunk/framework/common/widget/CommonScreens.xml (original) +++ ofbiz/trunk/framework/common/widget/CommonScreens.xml Tue Apr 21 08:03:41 2015 @@ -516,7 +516,7 @@ under the License. <actions> <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/> <set field="logoImageUrl" value="/images/ofbiz_logo.gif" global="true"/> - <property-to-field resource="fop.properties" field="defaultFontFamily" property="fop.font.family" default="Arial"/> + <property-to-field resource="fop.properties" field="defaultFontFamily" property="fop.font.family" default="NotoSans"/> </actions> <widgets> <platform-specific><xsl-fo><html-template location="component://common/webcommon/includes/reportTemplate.fo.ftl"/></xsl-fo></platform-specific> Modified: ofbiz/trunk/framework/webapp/config/fop.xconf URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/config/fop.xconf?rev=1675061&r1=1675060&r2=1675061&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/config/fop.xconf (original) +++ ofbiz/trunk/framework/webapp/config/fop.xconf Tue Apr 21 08:03:41 2015 @@ -97,6 +97,7 @@ the location of this file. --> <auto-detect/> <directory>framework/resources/fonts/NotoSans</directory> + <auto-embed/> </fonts> <!-- This option lets you specify additional options on an XML handler --> Modified: ofbiz/trunk/specialpurpose/example/widget/example/FormWidgetExampleScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/example/widget/example/FormWidgetExampleScreens.xml?rev=1675061&r1=1675060&r2=1675061&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/example/widget/example/FormWidgetExampleScreens.xml (original) +++ ofbiz/trunk/specialpurpose/example/widget/example/FormWidgetExampleScreens.xml Tue Apr 21 08:03:41 2015 @@ -132,6 +132,9 @@ under the License. </screen> <screen name="printExampleFOPFonts"> <section> + <actions> + <property-to-field resource="fop.properties" field="defaultFontFamily" property="fop.font.family" default="NotoSans" /> + </actions> <widgets> <platform-specific><xsl-fo><html-template location="component://example/webapp/example/reports/fonts.fo.ftl"/></xsl-fo></platform-specific> </widgets>