Log of #mupdf at irc.freenode.net.

Search:
 <<<Back 1 day (to 2018/11/25)20181126 
pink_mist sebras: ah, good! =) thanks! =)07:51.17 
paulgardiner tor8: I've run into a problem with using the stext from an annotation for positioning the caret when form filling. If the text widget is "combed", the characters are separated sufficiently that they are considered as separate words and space characters are inserted in the stext. I need to be able to get the character rectangle for a given index in the widget's text string.14:54.15 
tor8 paulgardiner: hm, mapping from index in the source string to output string is going to be impossible for say RTL text too15:00.15 
  maybe it's better to capture the fz_text somehow then15:00.25 
paulgardiner Does fz_text provide the bounding rect for each char?15:02.36 
  I'm happy with a hack that doesn't handle RTL for now.15:03.22 
  Other than that, it's almost working.15:03.51 
tor8 paulgardiner: how about a flag to the stext device to say 'don't add spaces'?15:05.33 
paulgardiner Yeah, that sounds good.15:05.49 
  ... still need the rects for the spaces that actually occur in the string though15:06.52 
tor8 yes, I'm thinknig of an FZ_STEXT_INHIBIT_SPACES to turn off the heuristic that adds spaces when there are gaps in the text15:07.33 
paulgardiner Sounds perfect15:07.46 
jogux paulgardiner: your whole question gives me the heebie-jeebies given the crazy unicode world we live in these days :)15:08.49 
paulgardiner la la la! :-)15:09.18 
  I need a fingers-in-ears smiley.15:09.45 
tor8 paulgardiner: top commit on tor/master (should be cherry-pickable to wherever you are)15:11.17 
paulgardiner tor8: magic. Thanks.15:11.29 
  jogux: actually, we're probably okay. Where I'm indexing the string, it's been converted from utf8 into an NSString, so with tor's fix the two structures should coinside.15:13.33 
  coincide even15:13.51 
jogux paulgardiner: you’re either better or worse than me at using NSString then :-)15:14.45 
  If the latter, https://www.objc.io/issues/9-strings/unicode/ has some hints.15:17.21 
paulgardiner Ta... although I'm just aiming at "mostly working" just now.15:18.31 
jogux yeah. Latin text will basically be fine. As long as no one puts decomposed strings into PDFs etc.15:19.53 
paulgardiner This current thing needs to work only for what we allow to be typed into form text widgets15:21.07 
tor8 jogux: should be fine, anything non-latin just gets turned into bullets anyway...15:26.42 
  until I improve the text synthesis code...15:26.51 
jogux ah, interesting.15:26.56 
tor8 it would be a minor tweak to make it support russian, greek, and CJK languages15:27.45 
  since there we have simple standard encodings and fallback fonts we can use in PDF15:28.00 
  anything else and we'd need to do something more radical to create the appearance streams15:28.16 
paulgardiner tor8: that doesn't look to be working, possibly because fz_new_stext_device isn't storing the opts in the device15:54.57 
  Sorted: just needed dev->flags = opts->flags added. Thanks Tor. That does look to have fixed the problem.16:04.59 
tor8 paulgardiner: nice.16:11.33 
 Forward 1 day (to 2018/11/27)>>> 
ghostscript.com #ghostscript
Search: