Blob Blame History Raw
From rt-cpan-org-return@perl.org Thu Apr 16 19:00:18 2015
Return-Path: rt-cpan-org-return@perl.org
Received: from zmta05.collab.prod.int.phx2.redhat.com (LHLO
 zmta05.collab.prod.int.phx2.redhat.com) (10.5.81.12) by
 zmail14.collab.prod.int.phx2.redhat.com with LMTP; Thu, 16 Apr 2015
 13:00:18 -0400 (EDT)
Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])
	by zmta05.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id A372F17C123
	for <ppisar@mail.corp.redhat.com>; Thu, 16 Apr 2015 13:00:18 -0400 (EDT)
Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.21])
	by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3GH0IDE022350
	for <ppisar@redhat.com>; Thu, 16 Apr 2015 13:00:18 -0400
Received: from rtcpan.develooper.com (rtcpan.develooper.com [207.171.7.181])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3GH0Hlj004418
	for <ppisar@redhat.com>; Thu, 16 Apr 2015 13:00:17 -0400
Received: by rtcpan.develooper.com (Postfix, from userid 536)
	id 91CAE5D7; Thu, 16 Apr 2015 10:00:16 -0700 (PDT)
Precedence: normal
Subject: [rt.cpan.org #103484] Font tests fail with hlv fonts
From: "KARASIK via RT" <bug-Prima@rt.cpan.org>
Reply-To: bug-Prima@rt.cpan.org
In-Reply-To: <rt-4.0.18-23549-1428916055-238.103484-6-0@rt.cpan.org>
References: <RT-Ticket-103484@rt.cpan.org>
 <rt-4.0.18-23549-1428916055-238.103484-6-0@rt.cpan.org>
Message-ID: <rt-4.0.18-29430-1429203616-1071.103484-6-0@rt.cpan.org>
X-RT-Loop-Prevention: rt.cpan.org
RT-Ticket: rt.cpan.org #103484
Managed-BY: RT 4.0.18 (http://www.bestpractical.com/rt/)
RT-Originator: KARASIK@cpan.org
To: ppisar@redhat.com
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Date: Thu, 16 Apr 2015 13:00:16 -0400
X-RedHat-Spam-Score: -1.9  (BAYES_00,SPF_PASS,URIBL_BLOCKED) 207.171.7.181 rtcpan.develooper.com 207.171.7.181 rtcpan.develooper.com <rt-cpan-org-return@perl.org>
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23
X-Scanned-By: MIMEDefang 2.68 on 10.5.110.21
Status: RO
Content-Length: 960
Lines: 22

<URL: https://rt.cpan.org/Ticket/Display.html?id=103484 >

Hi, thanks for the report! These fonts indeed are corner cases, reporting FXA_AVERAGE_WIDTHs inconsistent with the requested XLFD widths; I think I adapted for this now. May I ask you
to run the test again with the following patch and see if that works for you?

Sincerely, Dmitry

--- a/unix/apc_font.c
+++ b/unix/apc_font.c
@@ -1291,7 +1291,10 @@ AGAIN:

       /* detailing width */
       if ( f-> font. width == 0 || !f-> flags. width) {
-         if ( XGetFontProperty( s, FXA_AVERAGE_WIDTH, &v) && v) {
+        if ( f-> vecname && font-> width > 0) {
+            f-> font. width = font-> width;
+            Fdebug("font: width = copy as is %d\n", f->font.width);
+        } else if ( XGetFontProperty( s, FXA_AVERAGE_WIDTH, &v) && v) {
             XCHECKPOINT;
             f-> font. width = (v + 5) / 10;
             Fdebug("font: width = FXA_AVERAGE_WIDTH %d(%d)\n", f->font.width, v);