Commit c46137432e19c0701624eb3bcb954b4cf39ec6f5

Authored by Jay Berkenbilt
1 parent 887f35ef

TODO notes about text appearance streams

Showing 1 changed file with 31 additions and 0 deletions
@@ -34,6 +34,37 @@ Document-level work @@ -34,6 +34,37 @@ Document-level work
34 --copy-attachments-from to preserve these. What will the strategy be 34 --copy-attachments-from to preserve these. What will the strategy be
35 for deduplicating in the automatic case? 35 for deduplicating in the automatic case?
36 36
  37 +Text Appearance Streams
  38 +=======================
  39 +
  40 +This is a list of known issues with text appearance streams and things
  41 +we might do about it.
  42 +
  43 +* For variable text, the spec says to pull any resources from /DR that
  44 + are referenced in /DA but if the resource dictionary already has
  45 + that resource, just use the one that's there. The current code looks
  46 + only for /Tf and adds it if needed. We might want to instead merge
  47 + /DR with resources and then remove anything that's unreferenced. We
  48 + have all the code required for that in ResourceFinder except
  49 + TfFinder also gets the font size, which ResourceFinder doesn't do.
  50 +
  51 +* There are things we are missing because we don't look at font
  52 + metrics. The code from TextBuilder (work) has almost everything in
  53 + it that is required. Once we have knowledge of character widths, we
  54 + can support quadding and multiline text fields (/Ff 4096), and we
  55 + can potentially squeeze text to fit into a field. For multiline,
  56 + first squeeze vertically down to the font height, then squeeze
  57 + horizontally with Tz. For single line, squeeze horizontally with Tz.
  58 + If we use Tz, issue a warning.
  59 +
  60 +* When mapping characters to widths, we will need to care about
  61 + character encoding. For built-in fonts, we can create a map from
  62 + Unicode code point to width and then go from the font's encoding to
  63 + unicode to the width. Get rid of "ugly switch statements" in
  64 + QUtil.cc and replace with static map initializers. See
  65 + misc/character-encoding/ (not on github) and font metric information
  66 + for the 14 standard fonts in my local pdf-spec directory.
  67 +
37 Fuzz Errors 68 Fuzz Errors
38 =========== 69 ===========
39 70