bugGNU roff - Bugs: bug #58897, [PATCH] ellipses need kerning too

 
 

bug #58897: [PATCH] ellipses need kerning too

Submitter:  Dave <barx>
Submitted:  Tue 04 Aug 2020 04:33:02 PM UTC
   
 
Category:  Font devps Severity:  2 - Minor
Item Group:  Incorrect behaviour Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 14 Jan 2021 01:54:00 PM UTC, comment #3: 


commit 81b4ffadc1ced740ecb4e1eceff7dd0f3423c176 (HEAD -> master, origin/master, origin/HEAD)
Author: Dave Kemper <saint.snit@gmail.com>
Date:   Wed Aug 5 04:51:54 2020 +0000

    font/devps/*: Kern horizontal ellipsis correctly.

    Commit 87edb525, from 2003, added character U+2026 (HORIZONTAL ELLIPSIS)
    to most base groff fonts, but there has been no kerning information for
    this character.  To produce consistent typography, it should be kerned
    the same way as the period, which is in 818 kern pairs across all the
    devps fonts.

    Apply the following shell command to the groff description files
    of the PostScript fonts.

      for file in font/devps/*[A-Z]
        do sed -Ei\~ 's/(.*)(^| )\. (.*)/&\n\1\2u2026 \3/' $file
      done

    * font/devps/AB:
    * font/devps/ABI:
    * font/devps/AI:
    * font/devps/AR:
    * font/devps/BMB:
    * font/devps/BMBI:
    * font/devps/BMI:
    * font/devps/BMR:
    * font/devps/HB:
    * font/devps/HBI:
    * font/devps/HI:
    * font/devps/HNB:
    * font/devps/HNBI:
    * font/devps/HNI:
    * font/devps/HNR:
    * font/devps/HR:
    * font/devps/NB:
    * font/devps/NBI:
    * font/devps/NI:
    * font/devps/NR:
    * font/devps/PB:
    * font/devps/PBI:
    * font/devps/PI:
    * font/devps/PR:
    * font/devps/TB:
    * font/devps/TBI:
    * font/devps/TI:
    * font/devps/TR:
    * font/devps/ZCMI: Apply above script.

    Fixes <https://savannah.gnu.org/bugs/?58897>.  However, this will need
    to be done again if afmtodit is used to regenerate the above files, or
    afmtodit will need to be modified to add this kerning information
    itself.


G. Branden Robinson <gbranden>
Group administrator
Mon 26 Oct 2020 12:39:00 PM UTC, comment #2: 

It's not a patch file per se, but the script of comment #1 does patch the relevant files, so I'm marking this bug as "[PATCH]."

(I've tested the script under GNU bash 4.4.23 / GNU sed 4.7, and GNU bash 5.0.18 / GNU sed 4.8.)

The question (at the end of comment #0) about the correct long-term solution to this problem is still open.  But I submit that the proposed patch is a good-enough solution for the next release, as long as the change to the "kernpairs" sections of 29
devps font files is deemed low enough risk to make before then.

Dave <barx>
Group Member
Wed 05 Aug 2020 04:51:54 AM UTC, comment #1: 

original submission:

> It would be easy to write a script to patch these files
> by duplicating the . kernpairs for the ellipsis.


In fact, since I needed it for my own use anyway, I wrote this script (actually just a one-liner I entered at the shell prompt):


for file in font/devps/*[A-Z]; do sed -Ei\~ 's/(.*)(^| )\. (.*)/&\n\1\2u2026 \3/' $file ; done


It's an ugly and likely nonportable hack, but editing the font/devps files directly is probably the wrong solution anyway.

Dave <barx>
Group Member
Tue 04 Aug 2020 04:33:02 PM UTC, original submission:  

Commit 87edb525, from 2003, added character u2026 (HORIZONTAL ELLIPSIS) to most base groff fonts.  But to this day there is no kerning information for this character.


sed -n '/^kernpairs$/,/^$/p' font/devps/[A-Z]* | fgrep 2026 | wc -l


To produce consistent typography, it should be kerned the same way as the period, which is in 818 kern pairs across all the devps fonts.


sed -n '/^kernpairs$/,/^$/p' font/devps/[A-Z]* | fgrep . | wc -l


It would be easy to write a script to patch these files by duplicating the . kernpairs for the ellipsis.  But as bug #57506 points out, some aspect (perhaps the entirety) of these files is generated by afmtodit, so this shortcoming may be better addressed in that script, or in the original .afm files that script reads.

Dave <barx>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by barx (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-01-14 gbranden StatusNone Fixed
        Assigned toNone gbranden
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0
    2020-10-26 barx Severity3 - Normal 2 - Minor
        Summaryellipses need kerning too [PATCH] ellipses need kerning too

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code