[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fop-dev
Subject:    [jira] [Commented] (FOP-2858) [PATCH] FontUtil.guessStyle/guessWeight is passed java.awt.Font.getNam
From:       "Mikael Andersen (Jira)" <jira () apache ! org>
Date:       2021-12-25 7:36:00
Message-ID: JIRA.13227700.1555071899000.67311.1640417760218 () Atlassian ! JIRA
[Download RAW message or body]


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

Mikael Andersen commented on FOP-2858:
--------------------------------------

So [~ssteiner], what about applying this fix?

What additional information is required for it to be considered?

  

> [PATCH] FontUtil.guessStyle/guessWeight is passed java.awt.Font.getName() which can \
>                 return localized name
> ---------------------------------------------------------------------------------------------------------
>  
> Key: FOP-2858
> URL: https://issues.apache.org/jira/browse/FOP-2858
> Project: FOP
> Issue Type: Bug
> Components: font/unqualified, renderer/awt
> Affects Versions: 2.5, 2.2, 2.3, 2.4, 2.6
> Environment: Windows 10 Pro
> Reporter: Mikael Andersen
> Priority: Major
> Labels: patch, windows
> Attachments: InstalledFontCollectionTest.java, font.png, \
> guess_from_en_locale.patch, output.txt 
> Original Estimate: 1h
> Remaining Estimate: 1h
> 
> When  InstalledFontCollection enumerates OS provided Fonts, the style/weight is \
> guessed from java.awt.Font.getName(); Originally it was Font.getFontName() method, \
> which FOP-1452 fixed to getName(). As written in description of FOP-1452: \
> _Attaching patch which uses_ _Font.getName(), tested on Windows XP. Another \
> possibility would be to use_ _Font.getFontName(Locale.ENGLISH)._
> The latter option is exactly what I think it should be changed to, as I now \
> experience on my Windows 10 box (all in house experiences same), that \
> Font.getName() will return localized texts for style/weight, for most fonts, when  \
> user.language=da. The attached patch only targets passing proper name to \
> FontUtil.guessXXX methods, which are vital for proper rendering of preview and \
> printing (ps) for these fonts. However  Java2DGraphicsState.updateFont(...) is also \
> subject to  bug, as Font.getFontName() is used, {{ boolean updateName = \
> (!mapper.getFontName().equals(}} {{ getGraph().getFont().getFontName()));}}
> 
> effectively comparing Font.getName() with Font.getFontName() which will not always \
> match.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic