bugGNU roff - Bugs: bug #65109, [troff] no diagnostic in nroff...

 
 

bug #65109: [troff] no diagnostic in nroff mode when composite character unavailable

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Wed 03 Jan 2024 12:04:47 AM UTC
   
 
Category:  Core Severity:  3 - Normal
Item Group:  Warning/Suspicious behaviour Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 18 Jan 2024 07:31:51 PM UTC, comment #1: 

The following commit does not resolve the problem, but is adjacent to it, and helps distinguish problems with composite characters that are independent of the selected output device from those that arise because a device doesn't have support for a (composite) glyph.


commit 6008b6b7aa2920035e09d1dea44d262d30391195
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Thu Jan 18 12:45:57 2024 -0600

    [troff]: Diagnose bogus composite char escapes.

    [troff]: Diagnose bogus composite character escape sequences.  That is,
    when a composite character escape sequence like \[a ~] has a bogus
    modifier (as opposed to base) character, meaning one that has not been
    defined as the source _or_ destination of a `composite` request, warn
    about it.  For instance, \[a $] is nonsense, barring a request like
    `.composite $ \[uFF00]`, which would map `$`, when used as a modifier
    character in a composite special character escape sequence, to U+FF00,
    which would be a modifier form of the dollar sign in an alternate
    universe.

    * src/roff/troff/input.cpp (is_codepoint_composite): New function
      searches `composite_dictionary` for the presence of the given
      four-digit hexadecimal string as a key _or_ value.

    * src/roff/troff/input.h: Expose foregoing function to other translation
      units.

    * src/roff/troff/node.cpp (make_glyph_node): Check input `charinfo` for
      a Unicode code point sequence, and if it contains one, call
      `valid_unicode_code_sequence()` to check it for validity.  Then,
      iterate through each code point after the first {the base character},
      and call `is_codepoint_composite()` on it.  Diagnose invalid composite
      character and return null pointer if validation fails.

    Input:
    .nf
    \[A a~]
    \[A ~]
    \[u0041_0301]
    \[u0041_007E] \" should fail because 007E is explicitly spacing
    \[u0041_0041] \" same reason, more obviously
    \[u0041_0301_0301] \" should fail, would have a different meaning
    \[u0041_007E_0301] \" both problems above

    groff 1.23.0 and earlier:
    $ groff -T ps -z EXPERIMENTS/composite_character_construction.groff
    troff:...:5: warning: special character 'u0041_007E' not defined
    troff:...:6: warning: special character 'u0041_0041' not defined
    troff:...:7: warning: special character 'u0041_0301_0301' not defined
    troff:...:8: warning: special character 'u0041_007E_0301' not defined
    $ groff -Tutf8 -z EXPERIMENTS/composite_character_construction.groff
    [no output due to Savannah #65109]

    Now:
    $ ./build/test-groff -T ps -z EXPERIMENTS/composite_character_construction.groff
    troff:...:5: warning: special character 'u0041_007E' not defined
    troff:...:6: error: cannot format glyph: 'u0041_0041' is not a valid composite character
    troff:...:7: warning: special character 'u0041_0301_0301' not defined
    troff:...:8: warning: special character 'u0041_007E_0301' not defined
    $ ./build/test-groff -T utf8 -z EXPERIMENTS/composite_character_construction.groff
    troff:...:6: error: cannot format glyph: 'u0041_0041' is not a valid composite character


G. Branden Robinson <gbranden>
Group administrator
Wed 03 Jan 2024 12:04:47 AM UTC, original submission:  

Compare and contrast.


$ printf '\\[a $]\n' | groff -z -Tps
troff:<standard input>:1: warning: special character 'u0061_0024' not defined
$ printf '\\[a $]\n' | groff -z -Tutf8
$

This appears to have something to do with the "unicode" directive in the
device description file.

G. Branden Robinson <gbranden>
Group administrator

 

(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 (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.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-6207.
    Corresponding source code