Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2020/03/10)Fwd 1 day (to 2020/03/12) >>>20200311 
Guest45096 Where Can I see the print statements outputs in ghostscript?08:57.43 
kens Guest45096: I have no idea what you mean, what 'print statements' ?08:58.06 
Guest45096 "printf" statements added in the ghostscript code base08:58.58 
kens You can't (or at least shouldn't) use printf in the Ghostscript C code.08:59.21 
  If you try that you shoudl get a compiler warning telling you to use gs_sprintf instead08:59.42 
  Actually I'm thinking of sprintf there09:00.22 
  But nevertheless, you shouldn't be using printf09:00.30 
Guest45096 So if we use gs_sprintf, where can see the printed statements09:00.31 
kens Use emprintf or dmprintf09:00.48 
  dmprintf won't do anything except o debug builds, emprintf sends outptu to the PostScript stderr09:01.10 
  Why do you want to do this anyway ?09:01.26 
Guest45096 we have to get the code flow09:02.52 
kens Why ?09:03.03 
Guest45096 to have a better understanding of PS09:03.39 
kens Fiddling with the Ghostscript source code won't teach you very much about PostScript09:03.57 
  If you insist on watching the code execute, tehn use a debugger09:04.25 
Guest45096 which is the debugger we can use for that?09:05.43 
kens Well that depends doesn't it ? You haven't told me which operating system you are using, and clearly that's going to matter. You can't use CodeWarrior on Windows for example. Perhaps if you were to explain what you are really up to we could be more helpful.09:06.47 
chrisl Reading the PLRM is likely to reap better results in understanding PS09:06.56 
kens My sentiments exactly09:07.07 
Guest45096 UNIX is the debugger I am using09:07.43 
kens UNIX is not a debugger09:07.52 
Guest45096 *OS09:07.58 
kens Guest45096: I think you need to explain further what you are doing, and on whose behalf.09:08.23 
  Why do you want to mess with the Ghostscript code ?09:08.41 
Guest45096 thanks a lot for ur effort.09:08.56 
zdohnal Hi everyone, I have a question about gp_enumerate_fonts_next function13:00.27 
chrisl Well ask away!13:02.18 
zdohnal the way how it is implemented right now (together with z_fontenum), the loop in z_fontenum() will stop with the first font, for which fails one of FcPatternGet* functions13:03.52 
  chrisl: this way no fonts after 'failing' font is loaded13:04.18 
  chrisl: is it intended?13:04.29 
  chrisl: I'm solving RHEL/Fedora bug about loading fonts from fontconfig and I backported fix from git (bug 701969), but gs still does not load all installed fonts from /usr/share/fonts13:06.16 
  so I was debugging the issue and I found out that /usr/share/fonts/cantarell/Cantarell-VF.otf from abattis-cantarell-fonts package fails the FcPatternGetInteger function for FC_WEIGHT13:07.31 
chrisl Hmm, that does not look right, no13:08.19 
zdohnal I'm not sure whether if the reason of failure is in the font or in fontconfig, but gs stops iterating after that font13:08.33 
  so fontconfig loads 143 fonts, but gs loads only 60, because the looping stops on 61st font - that cantarell one...13:09.36 
chrisl From the comment, I would guess this was not our code to begin with13:09.57 
zdohnal chrisl: yep, but I'm not sure how much of the code is from RHEL7 patch13:10.43 
chrisl zdohnal: I would guess the entirety of the original fontconfig integration was lifted from it, but it was before my time.13:11.43 
  At a guess, we'd want the FcPattern* calls in a loop, and only return when we find a usable name, or the list is exhausted13:12.59 
zdohnal chrisl: ok, I'll check it13:17.14 
chrisl zdohnal: Something like: http://git.ghostscript.com/?p=user/chrisl/ghostpdl.git;a=commitdiff;h=55be2b0b9d94565de8ec177455e114b9ec43c2ef13:20.10 
zdohnal chrisl: ok, thank you!13:22.54 
  I'll check if it works13:23.02 
chrisl zdohnal: I was going to say: my testing was very brief! If it looks like it solves your issue, then I'll test it some more, and commit it (or something like it) to our repo13:24.05 
zdohnal chrisl: the patch seems to work, I'll run it in our CI tests and if they pass, it will be okay to add the patch from our side14:27.00 
chrisl zdohnal: Cool, thanks14:28.18 
zdohnal chrisl: our CI tests pass on Fedora, so imo it is good to go from us15:02.07 
chrisl zdohnal: Thanks. I'll someone to review it, and if they are happy, I'll push it15:02.40 
  zdohnal: Slight tweaj to what's getting pushed (functionally identical): http://git.ghostscript.com/?p=user/chrisl/ghostpdl.git;a=commitdiff;h=09a575f0fdc6edde7e42f325167318a1b199839f15:19.21 
  s/tweaj/tweak15:19.44 
zdohnal chrisl: lgtm15:20.12 
chrisl zdohnal: I'm just running it on our regression test cluster, then I'll push it15:20.56 
zdohnal chrisl: ok15:21.08 
chrisl Although, the regression cluster doesn't actually test the fontconfig code.....15:21.38 
zdohnal chrisl: I was thinking about how to improve the debug printf message - like I would like to know which font failed, but there is no guarantee about FcPatternGetString which brings file_fc will not fail...15:26.12 
  chrisl: so probably the ones which see such message will need to run debugger15:27.13 
chrisl zdohnal: I would assume that every font *must* have a FC_FILE value?15:28.11 
zdohnal chrisl: or just add it to debug messages where we know file_fc exists15:28.24 
  chrisl: I hope so :)15:28.51 
chrisl zdohnal: I was thinking if we change the order so the FC_FILE came first, then we could include that string in the other debug outputs15:29.13 
zdohnal chrisl: sounds good15:31.38 
chrisl zdohnal: I'll mess with that, if you like. It shouldn't take too long. Do you know which package Cantarell-VF.otf is in?15:32.56 
zdohnal chrisl: abattis-cantarell-fonts15:35.02 
  chrisl: looks like gnome fonts, git url is gitlab of gnome15:36.19 
chrisl Hmm, I have that installed, but I haven't noticed a failure15:36.54 
zdohnal chrisl: that would be nice if you change the order and add file_fc to debug msg, thank you!15:38.49 
  chrisl: maybe it is a fontconfig issue...15:39.18 
chrisl zdohnal: Or different versions of the font. I just makes it a little hard for me to see the result of my fiddling!15:39.58 
zdohnal chrisl: it was in fedora rawhide, I'll check it in a minute after the image starts up 15:42.53 
chrisl zdohnal: http://git.ghostscript.com/?p=user/chrisl/ghostpdl.git;a=commitdiff;h=b2d084d01a22261281fc35e990efc46dde6ea8f915:59.15 
zdohnal chrisl: abattis-cantarell-fonts-0.201-215:59.40 
  chrisl: looks good, thank you!16:00.35 
chrisl zdohnal: I'm on Ubuntu, so the packaging is different <sigh>16:04.22 
zdohnal chrisl: iirc ubuntu has similar functionality as Fedora has in dnf (dnf repoquery --whatprovides /path/to/file)16:05.47 
chrisl zdohnal: apt reports: fonts-cantarell/bionic,bionic,now 0.0.25-416:08.22 
  zdohnal: That's those two commits pushed to our main repo16:10.59 
zdohnal chrisl: I remembered - I can send you the file which triggers the issue for me16:17.36 
chrisl zdohnal: Unless there's a specific issue you want to look at, it's probably not necessary. If fontconfig can't get information from the file, it's unlikely we can use it, either.16:18.50 
zdohnal probably you can see there are message about missing fonts if you use unpatched gs16:21.06 
  chrisl: and those missing fonts are installed properly in /usr/share/fonts16:21.53 
chrisl zdohnal: It's up to you, I trust your testing of these changes, and if you're happy with them, then I'm happy.16:22.16 
zdohnal chrisl: just for the case if you want it to check by yourself or add it into testing suite16:23.05 
chrisl zdohnal: The same package here: https://rpmfind.net/linux/RPM/fedora/devel/rawhide/x86_64/a/abattis-cantarell-fonts-0.201-2.fc32.noarch.html ?16:26.12 
zdohnal chrisl: seems like it :)16:26.43 
chrisl zdohnal: Okay, it looks like it's working how we want, and expect now, which is all to the good :-)16:32.51 
zdohnal chrisl: thank you!16:47.52 
chrisl zdohnal: NP, you made a good catch, thanks for bringing it up16:48.38 
 <<<Back 1 day (to 2020/03/10)Forward 1 day (to 2020/03/12)>>> 
ghostscript.com #mupdf
Search: