IRC Logs

Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2014/10/14)20141015 
batsplat i am trying to create a tool that accepts multiple image formats and finally places them on a pdf. can i use ghostscript to import pngs in particular for this purpose?10:11.02 
Robin_Watts batsplat: Probably, yes.10:13.15 
  Look at the 'viewXXX' scripts in the gs library directory.10:13.32 
  There should be a viewjpg and a viewpng, I think,.10:13.41 
batsplat Robin_Watts: thanks, lemme check that out10:14.11 
  Robin_Watts: sorry, but where do i locate the gs library directory?10:17.29 
Robin_Watts batsplat: In the ghostscript source, there is a 'lib' directory.10:18.52 
  If you have the ghostpdl source, then it's gs/lib10:19.04 
  In there I see: viewcmyk.ps, viewgif.ps, viewjpeg.ps, viewmiff.ps, viewpbm.ps, etc.10:19.38 
  but no viewpng.ps10:19.42 
batsplat Robin_Watts: so does this mean I can't import pngs?10:39.03 
Robin_Watts batsplat: Well, either you can write a new viewXXX.ps file, or you can speak to ray later who may have one, or you can convert your PNG into something else and then import that.10:48.25 
tor8 batsplat: use pngtopnm then viewpbm.ps11:00.57 
nsz tor8 ive seen your Math.round fix but that's not correct11:02.22 
  ecma does not require the floor(x+.5) semantics, that's just a broken note in the standard11:02.45 
  i updated my article with a possible solution that gives conformant semantics11:03.27 
tor8 nsz: yeah, I guess I should just copy mozillas copysign(floor()) thing11:03.28 
nsz http://port70.net/~nsz/48_round.html11:03.38 
  no, copysign(floor) is wrong11:03.52 
  (it gives wrong result for 2^52 + 1 and nextafter(.5,0) and -2^52-2 etc)11:05.24 
tor8 nsz: right. that looks like a reasonable implementation.11:11.31 
  nsz: I've pushed a commit to my local repo that I hope works better11:14.33 
nsz ok11:15.25 
  i looked at other floating-point issues and i think dtoa and strtod needs several fixes11:17.13 
  i'll probably try to replace them with versions developed for musl if you dont mind11:17.46 
tor8 nsz: be my guest :)11:49.11 
henrychan How can I draw a circle annotation in a pdf ?14:15.00 
kens I'm not aware of an annotation of type 'circle'14:16.46 
  Hmm apparently there is such a thing14:18.27 
  So the question then becomes 'using what application ?'14:18.52 
henrychan mupdf 14:20.33 
  android version14:20.58 
kens Then I believe the answer is probably 'you can't'. I could be mistaken, but the developer who wrote the annotation code isn't here right now, so I can't check14:21.25 
henrychan Because I found 'FZ_ANNOT_CIRCLE' in some source code, but no sample to explain how to use it 14:23.06 
tor8 kens: henrychan: the android app only supports highlight, underline, strikeout and ink annotation types 14:23.35 
henrychan yes.14:24.29 
tor8 henrychan: MuPDFCore_addInkAnnotationInternal and MuPDFCore_addInkAnnotationInternal are where the guts of adding an annotation happen in the android app14:24.33 
  bah, MuPDFCore_addMarkupAnnotationInternal14:24.48 
  I'm not the main android developer, so take anything I say here with a grain of salt.14:25.23 
  but if you add a MuPDFCore_addCircleAnnotationInternal function modeled on those, and hook it up to the app, you have the android side done14:26.45 
  then you'll need to add circle annotation support to pdf_update_appearance14:26.56 
  the annotation creation stuff is still a work in progress, so there may be dangers lurking around the corners14:27.53 
henrychan I think the point is doing enhancement in the 'pdf_update_appearance' , right ?14:29.26 
  any enhancement about this from v1.5 to v1.6 ??14:30.50 
  another question, how can I save the annotations into file after call MuPDFCore_addInkAnnotationInternal ?14:37.52 
henrys mvrhel_laptop: hey did you try out your 365 yet?15:00.36 
mvrhel_laptop shoot I forgot about it. I got sucked into this sot bug15:07.45 
  let me do it now15:08.27 
henrys mvrhel_laptop: no hurry just curious if I'm the only one ... paul and robin are okay15:09.14 
mvrhel_laptop henrys: it works fine15:14.53 
  crazy user ID though15:15.12 
  heading to coffee shop bbiab15:15.44 
rayjj kens: I closed that nonsense bug about warning suppression bug 695600 15:16.29 
henrys mvrhel_laptop: thanks15:16.34 
kens rayjj I was going to give him a small chance to supply an example, but hey.15:16.50 
rayjj that guy had so many problems with his command line he probably will never get there15:17.15 
kens I suspect he's trying to use pdfwrite to create a PDF file and send it to stdout, and that's a project doomed to failure15:17.16 
rayjj kens: is it? pdfwrite needs to seek in the output file ?15:17.52 
kens rayjj in general, no, in the case of a linearised file, most definitely yes. And I won't guarantee that I won't add something else that requires a real file to seek in at some point15:18.32 
Robin_Watts rayjj, mvrhel_laptop: Your kids may like http://www.codingame.com16:39.05 
  some of the problems on there are quite interesting.16:39.16 
mvrhel_laptop Robin_Watts: cool!16:39.28 
  I need things like this 16:39.38 
Robin_Watts I spent some time last weekend doing a load of them.16:39.40 
  and then the server crashed and lost all my progress :(16:39.58 
mvrhel_laptop :(16:40.02 
tomty89 hello do yo guys still have anything to do with "ghostscript fonts"16:40.06 
Robin_Watts We do, ish.16:40.21 
tomty89 is 8.11 still the latest version? or you include some more polished ones in certain package?16:41.02 
Robin_Watts tomty89: We provide fonts as part of ghostscript.16:41.29 
  I think I'm right in saying that we don't package them separately any more.16:41.46 
  The guy who knows about this is chrisl, and he's away today.16:41.59 
tomty89 so the source package here have the fonts? http://ghostscript.com/download/gsdnld.html 16:42.26 
Robin_Watts They do.16:42.37 
tomty89 ok thanks! sorry i should check myself but somehow i can't download it successfully for now16:43.12 
rayjj tomty89: you can also get the fonts by pulling http://git.ghostscript.com/?p=ghostpdl.git;a=tree;f=gs/Resource/Font;h=44a7a32fae0b0f7358effa1bce977bf200a5687a;hb=HEAD contents18:32.02 
  tomty89: the Aladdin Free Public License TTF URW fonts are at http://git.ghostscript.com/?p=ghostpdl.git;a=tree;f=urwfonts;h=f37e2dd371ec6ffc1c613dc1ae40bfd940b1c020;hb=HEAD18:33.07 
  tomty89: the AFPL is somewhat more restrictive than the AGPL in that it disallows ANY commercial use other than with a packaged distro18:33.57 
tomty89 may i ask what's the format of font in Resource/Font?18:36.45 
  there're no extension names for them18:37.25 
rayjj tomty89: sorry -- I wasn't paying attention. The Resource/Font files are all .pfb files (PostScript Type 1)18:39.27 
tomty89 hmm when i compare the file size i thought they are afm18:40.22 
  rayjj: seems much smaller than those in the 8.11 package18:40.38 
rayjj tomty89: the 8.11 package may have had some of the old crufty .gsf fonts in there Hershey, etc.18:41.32 
  tomty89: BTW, the correspondence to "well known" (trademarked?) font names is in Resource/Init/Fontmap. For example: /Helvetica/NimbusSanL-Regu;18:42.42 
  that means that NimbusSanL-Regu is the URW equivalent to Helvetica (which is similar to Arial)18:43.33 
tomty89 rayjj: actually i have sort of a problem. those fonts works fine more most programs, but when it comes to libreoffice, they can't be detected. according to some, pfb only is sort of non-standard so they are not going to fix anything.18:44.07 
  rayjj: so i just wonder if i have missed some steps to use them18:44.19 
  rayjj: or maybe just afm (and pfm) wouldn't be maintained18:44.44 
rayjj tomty89: Not sure since I don't use libreoffice. You may want to use the TTF fonts I mentioned above -- those probably will be usable18:45.18 
  useable ??18:45.26 
tomty89 *usable i suppose18:45.40 
rayjj my spell checker accepts both. Don't tell my daughter that I had trouble spelling something :-)18:46.22 
tomty89 hmm18:46.31 
  but does ghostscript provide anything to generate/convert them to afm?18:46.35 
  *ahh seems both are fine http://www.oxforddictionaries.com/definition/english/usable?q=useable18:47.19 
rayjj tomty89: AFM is *NOT* a font format18:47.25 
  tomty89: yeah, I found http://english.stackexchange.com/questions/69709/is-useable-preferred-in-certain-regions-or-just-an-alternate-spelling-of-usa18:47.33 
  tomty89: gs can generate AFM's from Type1 fonts 18:48.03 
  (in fact I am pretty sure that's what URW uses to generate the AFM's they ship)18:48.35 
  tomty89: AFM's are "Adobe Font Metric" files which are not the actual fonts, but just information *about* the fonts -- glyph widths, heights, kerning, etc.18:49.33 
tomty89 yeah i read a bit about that18:50.37 
rayjj tomty89: AFM's are an adjunct to fonts designed to be used by word processing programs to be able to "layout" a font (maybe one they can't even render, and use a substitute font to show in a word processing app)18:50.54 
tomty89 what about pfm? can gs generate them as well?18:52.37 
rayjj tomty89: gs has lib/pf2afm* The pf2afm.ps actually does the work: usage: gs [-dNODISPLAY] -- pf2afm.ps disk_font_name18:52.52 
tomty89 yeah i found that, just notice that it only accept file with appropriate extension names 18:53.45 
  i thought it was not working18:53.59 
rayjj tomty89: i guess it is slightly bitrotted in that it needs the .pfb extension. I renamed NimbusSanL-Regu to x.pfb and ran: gs -- lib/pf2afm.ps x.pfb 18:58.16 
  and it generated x.pfm18:58.21 
  tomty89: so I guess a "for" (or foreach C-shell) and a bit of basic shell magic can generate the afm's for you18:59.27 
tomty89 yeah that's what i'm trying :D18:59.52 
rayjj tomty89: as in: mkdir afmdict ; for f in Resource/Font/* ; do fn=`basename $f`; cp $f $fn.pfb ; echo $fn ; gs -q -- lib/pf2afm.ps $fn ; mv $fn.afm afmdict; done19:06.24 
  tomty89: note that it fails on Dingbats and StandardSymL which are "symbolic" fonts19:07.16 
  tomty89: but I'm not sure we ever had .afm files for those anyway19:07.39 
tomty89 i think there are, tho might they might not be generated by you/gs19:08.27 
rayjj tomty89: and that bash snippet above leaves the .pfb files laying around :-(19:08.36 
  but other than that minor bug ;-) it worked for me :-)19:09.08 
  tomty89: actually it's a "feature" since you may need file with the .pfb extension for libreoffice ;-)19:09.59 
  tomty89: and I was actually testing it on msys with gswin32c (caveat emptor) :-)19:11.14 
rayjj thinks we need an emoticon ffor caveat emptor19:11.55 
tomty89 unfortunately extension is not the problem for LO19:12.43 
rayjj well, I guess you have to ask them (or hack into LO) :-(19:13.24 
  tomty89: I'm pretty sure LO uses FreeType (as gs does) so I know that the fonts are OK19:14.17 
tomty89 yeah all other apps works without afm19:14.55 
rayjj tomty89: not surprising that LO uses/wants the AFM -- font kerning is something that word/document processors often use.19:15.40 
  tomty89: you may try the TTF fonts -- TrueType fonts have 'kern' tables and shouldn't need any AFM19:16.14 
  tomty89: but if this used to work (gs fonts with LO) I can't imagine why it's unhappy (probably a font search path issue or something)19:17.14 
tomty89 actually i'm an arch linux user, and i want to suggest to the devs to replace the gsfonts package in its repo, since it's built from some old fedora rpm (which consists of pfb, pfm and afm for all 35 fonts)19:17.45 
rayjj IMHO any app that relies on "extension" to recognize file type is brain-dead/broken19:17.56 
rayjj is chagrined at giving an arch linux user a hackish shell script19:18.56 
  we see a *LOT* of noobs here19:19.29 
tomty89 oh i'm just a noob19:19.32 
  lol19:19.35 
rayjj tomty89: not really a noob -- you didn't ask what the shell script meant or what to do with it ;-)19:20.17 
tomty89 :)19:20.58 
rayjj and I recall being a noob back in 1974 when I had trouble getting around in MIT's unix system (that I got a back door login to).19:22.20 
  I did manage to download source for their lisp system -- almost got it building on our PDP-11/70 when the semester ended 19:23.36 
  time for lunch. bbiaw19:25.16 
  tomty89: good luck with LO.19:25.38 
tomty89 thanks, see ya19:26.15 
dinamic_ evning folks22:07.19 
  anyone around that knows mujs ?22:07.33 
  how should I iterate over an objects properties ?22:08.35 
  could I get the keys prototype property function and call it ?22:09.34 
henrys mvrhel_laptop: sorry to bother you again but do you have the business pro version? Joann is trying to fix this.22:30.20 
mvrhel_laptop henrys: let me check22:30.37 
  I have a business version. trying to figure out if if is pro.22:39.14 
  all these MS adjectives22:39.20 
  trying to figure out how to just install word, excel and power point I really dont want all the other stuff22:41.02 
henrys mvrhel_laptop: install it I thought it was installed on the cloud ;-)22:42.30 
mvrhel_laptop well there is an online version and you can download the latest desktop version22:42.53 
  but it installs everything it looks like22:43.06 
henrys probably runs on a linux machine for security :-)22:43.16 
mvrhel_laptop onenote, publisher, outlook. etc etc22:43.27 
  I need to clean up a few things on this machine before I go down that route22:43.39 
  but I def. have a business version henry22:45.00 
henrys mvrhel_laptop: surprised there is a desktop version. Why wouldn't you just go buy that instead? the point is to have this accessible from all devices right?22:45.06 
mvrhel_laptop right. but what will you do when you are on the plane?22:45.21 
  you will need to have a local copy22:45.36 
  it really assumes connectivity always22:45.49 
  it is interesting the way the "OneDrive" works22:46.05 
  you can have "local" copies of some files22:46.12 
henrys mvrhel_laptop: I thought something minimal like the ipad app, well maybe that isn't so minimal22:46.35 
mvrhel_laptop and everything syncs up later22:46.39 
henrys mvrhel_laptop: is one drive mirrored on the desktop like drobbox?22:47.11 
mvrhel_laptop yes22:47.15 
  but very integrated into windows22:47.22 
  I have about 120G on one drive22:47.33 
henrys mvrhel_laptop: I like dropbox because of linux and mac support22:48.03 
mvrhel_laptop right22:48.07 
  the one drive account is tied to my windows login so it just automatically shows up on my desktop, laptop and surface22:50.42 
  anyway back to the xml salt mine22:51.21 
 Forward 1 day (to 2014/10/16)>>> 
ghostscript.com
Search: