[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#880407: still occurs in xterm 352-1



On Mon, Jan 20, 2020 at 11:18:16PM +0100, Vincent Lefevre wrote:
> Control: reopen -1
> Control: found -1 352-1
> 
> On 2020-01-20 18:07:01 +0000, Sven Joachim wrote:
> > Changes:
> >  xterm (352-1) unstable; urgency=medium
> >  .
> >    * New upstream release.
> >      - Adjust fontsize data to handle a minor inconsistency from recent Xft
> >        versions (Closes: #880407, adapted from patch by Vincent Lefevre).
> 
> The bug still occurs with 352-1. Note that my patch was still
> working with 351-1.

The change that I used gave me the same result for the font which you
mentioned in the bug report.  You may be using some different font.

Keep in mind that you're rating a 1 or 2 pixel change in the size
as "important".  Without a screen-magnifier (or printing the data
in a log file), others won't notice this problem.

However, in reviewing the suggested change, I found that more than 90%
of the fonts on my system would be 1 pixel in error.  Less than 10%
adjusted the height consistently with ascent/descent.

Doing that test takes about a half hour on my machine, and makes it
unusable during the test.  Script is attached, feel free to run it
a few times.

The part where you're modifying the inputs to the calculation didn't
change the result for the font you specified.  Just as well (since
modifying the inputs will make the results less predictable), but if
you can identify the problem which it was intended to fix, you might
come up with a workable solution.

-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net
#!/usr/bin/env perl
# $Id: all-xft,v 1.4 2020/01/15 01:39:37 tom Exp $
# -----------------------------------------------------------------------------
# Copyright 2020 by Thomas E. Dickey
#
#                         All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
# Use fc-list to obtain a list of TrueType font families, and execute an
# xterm-style command for each of those.

use strict;
use warnings;

use Getopt::Std;

$| = 1;

our ( $opt_d, $opt_e, $opt_s, $opt_t, $opt_x );

our @families;

sub fc_list() {
    my @data;
    my %result;
    if ( open my $fh, "fc-list : family |" ) {
        @data = sort <$fh>;
        chomp @data;
        close $fh;
        for my $n ( 0 .. $#data ) {
            my @items = split /,/, $data[$n];
            for my $q ( 0 .. $#items ) {
                $result{ $items[$q] } = $n;
            }
        }
    }
    return sort keys %result;
}

sub quoted($) {
    my $text = shift;
    $text =~ s/\\/\\\\/g;
    $text =~ s/"/\\"/g;
    return '"' . $text . '"';
}

sub doit($) {
    my $family = shift;
    printf "** %s\n", $family;
    my $cmd = sprintf( "%s -fa %s", $opt_x, &quoted($family) );
    $cmd .= sprintf( " -fs %s",               $opt_s )          if ($opt_s);
    $cmd .= sprintf( " -xrm \"Xft.dpi: %s\"", $opt_d )          if ($opt_d);
    $cmd .= sprintf( " -e %s",                &quoted($opt_e) ) if ($opt_e);
    $cmd = "time -p " . $cmd if ($opt_t);
    system($cmd);
}

sub main::HELP_MESSAGE() {
    printf STDERR <<EOF
Usage: $0 [options]

Options:

-d DPI     pass -xrm option to PROG to set Xft.dpi
-e CMD     pass to PROG
-s SIZE    pass -fs SIZE to PROG (default: "10")
-t         time PROG
-x PROG    use PROG (default: "xterm")
EOF
      ;
    exit;
}

$Getopt::Std::STANDARD_HELP_VERSION = 1;
&getopts('d:e:s:tx:') || &main::HELP_MESSAGE;
$opt_x = "xterm" unless $opt_x;
if ( $#ARGV >= 0 ) {
    $opt_e = join( ' ', @ARGV ) unless $opt_e;
}

@families = &fc_list;
for my $n ( 0 .. $#families ) {
    &doit( $families[$n] );
}

1;

Attachment: signature.asc
Description: PGP signature


Reply to: