You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by "Andrej Slamka (JIRA)" <ji...@apache.org> on 2019/01/09 15:19:00 UTC

[jira] [Commented] (FOP-2704) Google fonts Roboto font (updated 2017) UnsupportedOperationException: coverage set class table not yet supported

    [ https://issues.apache.org/jira/browse/FOP-2704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16738332#comment-16738332 ] 

Andrej Slamka commented on FOP-2704:
------------------------------------

The setting <complex-scripts disabled="true"> works only for PDFs. When rendering pictures (eg. PNG ...) this setting doesn't work. In this case the ConfiguredFontCollection Class is used, which when no metrics are provided, ignores this setting.

See ConfiguredFontCollection.setup()
{code:java}
if (metricsURI != null) {
	LazyFont fontMetrics = new LazyFont(configFontInfo, resourceResolver, useComplexScripts);
	InputStream fontSource = resourceResolver.getResource(fontURI);
	font = new CustomFontMetricsMapper(fontMetrics, fontSource);
} else {
	FontUris fontUris = configFontInfo.getFontUris();
	CustomFont fontMetrics = FontLoader.loadFont(fontUris,
			configFontInfo.getSubFontName(), true,
			configFontInfo.getEmbeddingMode(), configFontInfo.getEncodingMode(),
			configFontInfo.getKerning(), configFontInfo.getAdvanced(), resourceResolver,
			configFontInfo.getSimulateStyle(), configFontInfo.getEmbedAsType1());
	font = new CustomFontMetricsMapper(fontMetrics);
}
{code}
Is there a workaround for rendering images?

> Google fonts Roboto font (updated 2017) UnsupportedOperationException: coverage set class table not yet supported
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: FOP-2704
>                 URL: https://issues.apache.org/jira/browse/FOP-2704
>             Project: FOP
>          Issue Type: Bug
>          Components: font/opentype
>    Affects Versions: 2.1, 2.2
>            Reporter: Dan Caprioara
>            Priority: Major
>         Attachments: Roboto-Regular.ttf, Roboto-Thin.ttf
>
>
> Steps:
> # Download the Roboto TTF font from Google Fonts. 
> # Create a configuration file with a triplet pointing to the "roboto-regular" or "roboto-thin" TTF file.
> You get:
> {code}
> java.lang.UnsupportedOperationException: coverage set class table not yet supported
> 	at org.apache.fop.complexscripts.fonts.GlyphClassTable$CoverageSetClassTable.<init>(GlyphClassTable.java:262)
> 	at org.apache.fop.complexscripts.fonts.GlyphClassTable.createClassTable(GlyphClassTable.java:88)
> 	at org.apache.fop.complexscripts.fonts.OTFAdvancedTypographicTableReader_Original.readGDEFMarkGlyphsTableFormat1(OTFAdvancedTypographicTableReader_Original.java:3344)
> 	at org.apache.fop.complexscripts.fonts.OTFAdvancedTypographicTableReader.readGDEFMarkGlyphsTableFormat1(OTFAdvancedTypographicTableReader.java:69)
> 	at org.apache.fop.complexscripts.fonts.OTFAdvancedTypographicTableReader_Original.readGDEFMarkGlyphsTable(OTFAdvancedTypographicTableReader_Original.java:3357)
> 	at org.apache.fop.complexscripts.fonts.OTFAdvancedTypographicTableReader_Original.readGDEF(OTFAdvancedTypographicTableReader_Original.java:3427)
> 	at org.apache.fop.complexscripts.fonts.OTFAdvancedTypographicTableReader_Original.readAll(OTFAdvancedTypographicTableReader_Original.java:80)
> 	at org.apache.fop.fonts.truetype.OpenFont.handleCharacterSpacing(OpenFont.java:786)
> 	at org.apache.fop.fonts.truetype.OpenFont.readFont(OpenFont.java:755)
> 	at org.apache.fop.fonts.truetype.OFFontLoader.read(OFFontLoader.java:109)
> 	at org.apache.fop.fonts.truetype.OFFontLoader.read(OFFontLoader.java:93)
> {code}
> There are two changes that should be done to the {{OTFAdvancedTypographicTableReader}}.
> # The method {{readGDEFMarkGlyphsTableFormat1}} should catch this exception
> # The method {{constructLookupsLanguage}} should check if the {{languages}} parameter is null.
> After these changes, the PDF is produced and it looks good. I am not sure what are the side effects on the font that is embedded into the PDF..



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)