You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by GitBox <gi...@apache.org> on 2020/09/09 13:46:19 UTC

[GitHub] [jmeter] weisJ opened a new pull request #618: Ensure fallback enabled fonts are used.

weisJ opened a new pull request #618:
URL: https://github.com/apache/jmeter/pull/618


   ## Description
   Makes sure the used fonts are fallback enabled.
   
   ## Motivation and Context
   As reported in https://github.com/apache/jmeter/pull/499#issuecomment-689346454 Darklaf has issues with displaying certain character sets. This has been fixed in in darklaf version `2.4.7`. 
   
   The issue stems from the fact that darklaf uses the native system font instead of the default `Dialog` font. Unlike the logical fonts physical fonts don't fallback to another font if certain characters are unsupported.
   Because constructs like `new Font(...)` and `Font#derive(getAttributes())` either don't produce a fallback enabled font or don't preserve the underlying `Font2D` instance (which is responsible for fallback handling if of type `CompositeFont`) those had to be replaced to ensure all characters are displayed correctly.
   -  `Font#derive(getAttributes())` was used to produce a non `UIResource` font and has been replaced by subclassing `Font` through `NonUIResourceFont` which exposes a constructor that takes a `Font` instance and preserves the `Font2D` handle.
   - `new Font(...)` was replaced by `StyleContext#getFont(String,int,int)` which creates a `CompositeFont` if necessary. (The result is wrapped using `NonUIResourceFont` because the result may be of type `FontUIResource`).
   
   I'm not quite sure whether `JMeterUIDefaults` is the correct/best class to place the `Font` factory method though.
   
   ## How Has This Been Tested?
   
   ## Screenshots (if appropriate):
   
   ## Types of changes
   - Bug fix (non-breaking change which fixes an issue)
   
   ## Checklist:
   <!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
   <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
   - [x] My code follows the [code style][style-guide] of this project.
   - [ ] I have updated the documentation accordingly.
   
   [style-guide]: https://wiki.apache.org/jmeter/CodeStyleGuidelines
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jmeter] pmouawad commented on pull request #618: Ensure fallback enabled fonts are used.

Posted by GitBox <gi...@apache.org>.
pmouawad commented on pull request #618:
URL: https://github.com/apache/jmeter/pull/618#issuecomment-704740141


   Hello @weisJ ,
   I was not able to reproduce the issue on windows neither.
   Can you clarify what problem this issue fixes and how to reproduce the bug to confirm it's fixed ?
   Thanks


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jmeter] weisJ commented on pull request #618: Ensure fallback enabled fonts are used.

Posted by GitBox <gi...@apache.org>.
weisJ commented on pull request #618:
URL: https://github.com/apache/jmeter/pull/618#issuecomment-700192956


   > Hello @weisJ ,
   > Did you also test with non darklaf LAF ?
   > Thanks
   
   Yes this does work with all LaFs. In particular this fix isn't really specific to darklaf but rather any LaF/Component that uses a non-logical font i.e. regardless of the Laf the following won't display the characters:
   ````java
   JFrame frame = new JFrame("Test");
   JPanel content = new JPanel(new BorderLayout());
   JLabel label = new JLabel("日 月 木 水 火 犬 王 正 出 本 右 四 左 玉");
   label.setFont(new Font("Arial", Font.PLAIN, 12));
   content.add(label);
   frame.setContentPane(content);
   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   frame.pack();
   frame.setLocationRelativeTo(null);
   frame.setVisible(true);
   ````


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jmeter] pmouawad merged pull request #618: Ensure fallback enabled fonts are used.

Posted by GitBox <gi...@apache.org>.
pmouawad merged pull request #618:
URL: https://github.com/apache/jmeter/pull/618


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jmeter] pmouawad commented on pull request #618: Ensure fallback enabled fonts are used.

Posted by GitBox <gi...@apache.org>.
pmouawad commented on pull request #618:
URL: https://github.com/apache/jmeter/pull/618#issuecomment-700652962


   Hello @weisJ ,
   I don't reproduce the reported issue on Mac OSX.
   So I would need somebody to test on Windows where it happens I guess.
   
   Regards


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jmeter] weisJ commented on pull request #618: Ensure fallback enabled fonts are used.

Posted by GitBox <gi...@apache.org>.
weisJ commented on pull request #618:
URL: https://github.com/apache/jmeter/pull/618#issuecomment-704807540


   Using Windows with Java 12.0.1 and Japanese as the selected language in JMeter
   
   - Master branch:
      ![font_issue](https://user-images.githubusercontent.com/31143295/95311964-9ef27480-088e-11eb-8a5e-677cfce403c3.png)
   
   - This branch:
      ![font_issue_fixed](https://user-images.githubusercontent.com/31143295/95311976-a3b72880-088e-11eb-896a-3e681de67ece.png)
   
   Notice how the glyphs for the test plan label aren't rendered on master. The label is using a modified font-size. The old method of obtaining the derived font stripped away the composite font2d handle which is why the characters can't be displayed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jmeter] pmouawad commented on pull request #618: Ensure fallback enabled fonts are used.

Posted by GitBox <gi...@apache.org>.
pmouawad commented on pull request #618:
URL: https://github.com/apache/jmeter/pull/618#issuecomment-699629289


   Hello @weisJ ,
   Did you also test with non darklaf ?
   Thanks


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jmeter] pmouawad edited a comment on pull request #618: Ensure fallback enabled fonts are used.

Posted by GitBox <gi...@apache.org>.
pmouawad edited a comment on pull request #618:
URL: https://github.com/apache/jmeter/pull/618#issuecomment-699629289


   Hello @weisJ ,
   Did you also test with non darklaf LAF ?
   Thanks


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jmeter] pmouawad commented on pull request #618: Ensure fallback enabled fonts are used.

Posted by GitBox <gi...@apache.org>.
pmouawad commented on pull request #618:
URL: https://github.com/apache/jmeter/pull/618#issuecomment-690674841


   Hello @weisJ ,
   It looks good to me. Thanks


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org