Your message dated Fri, 11 Mar 2022 13:53:06 -0800
with message-id 
<caescoivjuxpemeqr8vwofq+ehyfaiuhc8rqvsj_lnd6w2bw...@mail.gmail.com>
and subject line Avez-vous besoin d'un prêt?
has caused the Debian Bug report #834053,
regarding openjdk-8: java.awt.Font#deriveFont(int style) corrupts font size
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
834053: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=834053
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: openjdk-8
Severity: normal
Tags: patch

Dear Maintainer,

Problem
=======

java.awt.Font#deriveFont(int style) tries to create new Font instance
that has the same font size. But it uses rounded font size wrongly.
So derived font has different font size.
(openjdk-7 has a same problem.)


Sample code
===========

import java.awt.Font;

public class DeriveFontProblem {
    public static void main(String[] args) {
        Font fontBase = new Font("Helvetica", Font.PLAIN, 1);
        Font font105 = fontBase.deriveFont(10.5f);
        System.out.println("font105     : size=" + font105.getSize2D());
        Font font105Plain = font105.deriveFont(Font.PLAIN);
        System.out.println("font105Plain: size=" + font105Plain.getSize2D());
    }
}


Result of this code
===================

Actual
>font105     : size=10.5
>font105Plain: size=11.0

Expected
>font105     : size=10.5
>font105Plain: size=10.5


Suggested fix
=============

Font#deriveFont(int style) should use (float) "pointSize", not (int) "size".
Here is a patch to fix:

--- java/awt/Font.java.orig    2016-08-12 01:03:10.703646834 +0900
+++ java/awt/Font.java    2016-08-12 01:02:43.091646225 +0900
@@ -1933,7 +1933,7 @@
      */
     public Font deriveFont(int style){
         if (values == null) {
-           return new Font(name, style, size, createdFont, font2DHandle);
+           return new Font(name, style, pointSize, createdFont, font2DHandle);
         }
         AttributeValues newValues = getAttributeValues().clone();
         int oldStyle = (this.style != style) ? this.style : -1;


Reportbug output
================

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'oldstable-updates'), (500,
'unstable'), (500, 'oldstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.14-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=ja_JP.UTF-8, LC_CTYPE=ja_JP.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect

--- End Message ---
--- Begin Message ---
*Vous avez besoin d'un prêt pour votre entreprise, besoin d'un prêt rapide
pour régler vos factures, pour un usage personnel ? Notre offre propose des
prêts avec un faible taux d'intérêt de 3%. Avez-vous pensé à contracter un
prêt ? Vous avez probablement été rejeté par votre banque locale ? Veuillez
répondre pour plus d'informations: [email protected]
<[email protected]>*

--- End Message ---

Reply via email to