Then I replaced "${nw}x${nh}" with "$((${mult}*100))%" it this line:
if ! convert "${_f}" -resize "$((${mult}*100))%" "${target}"; then
The script ran! Here's an output example:
Notice[picture_multiplier.sh]: Saving as: /home/david/Code/scientificaGLYPHS/bold_png/multiplier-output/U+03C4.png}/U+03C4.png
Notice[picture_multiplier.sh]: Converting /home/david/Code/scientificaGLYPHS/bold_png/U+2295.png from 5x5 to 0x0.
Notice[picture_multiplier.sh]: Saving as: /home/david/Code/scientificaGLYPHS/bold_png/multiplier-output/U+2295.png}/U+2295.png
Notice[picture_multiplier.sh]: Converting /home/david/Code/scientificaGLYPHS/bold_png/U+0173.png from 5x8 to 0x0.
Notice[picture_multiplier.sh]: Saving as: /home/david/Code/scientificaGLYPHS/bold_png/multiplier-output/U+0173.png}/U+0173.png
Notice[picture_multiplier.sh]: Converting /home/david/Code/scientificaGLYPHS/bold_png/U+010A.png from 4x9 to 0x0.
Notice[picture_multiplier.sh]: Saving as: /home/david/Code/scientificaGLYPHS/bold_png/multiplier-output/U+010A.png}/U+010A.png
Summary[picture_multiplier.sh]: Successful conversions: 974
Summary[picture_multiplier.sh]: Failed conversions: 1
I don't know which one failed, but anyway the images scaled 2 times instead of twenty-five (the first one is 1x1, makes it easy to control). Also, each png was output to it's own subfolder in the destination directory. I'm guessing that's to do with this:
But the real kicker is: it seems all I was missing was the % argument for mogrify -resize. I ran mogrify -resize 2500% *.png and checked the size of a few output glyphs. It seems to have worked well!
This was a big step forward, and your script helped me to understand how a lot of this works. It actually encouraged me to start something I've been pondering, which is to learn bash.
sh picture_multiplier.sh ~/Code/scientificaGLYPHS/bold_png/ ~/Code/scientificaGLYPHS/bold_png/multiplier-output/
2
Notice[picture_multiplier.sh]: Source Dir: /home/david/Code/scientificaGLYPHS/bold_png
Notice[picture_multiplier.sh]: Dest Dir: /home/david/Code/scientificaGLYPHS/bold_png/multiplier-output
Notice[picture_multiplier.sh]: Multiplier: 2
Notice[picture_multiplier.sh]: Time to abort before execution: 5s
identify: no decode delegate for this image format `' @ error/constitute.c/ReadImage/512.
identify: no decode delegate for this image format `' @ error/constitute.c/ReadImage/512.
picture_multiplier.sh: line 88: *2: syntax error: operand expected (error token is "*2")
The only thing I changed on the script was the shebang, to '/bin/sh', because I'm using zsh.
EDIT: This problem is not related to your script. It seems that the Imagemagick in the Arch repos doesn't come with the adequate libraries. I'll install imagemagick-full from the AUR and try again.
EDIT2: Nope, still:
identify: no decode delegate for this image format `' @ error/constitute.c/ReadImage/512.
identify: no decode delegate for this image format `' @ error/constitute.c/ReadImage/512.
picture_multiplier.sh: line 88: *2: syntax error: operand expected (error token is "*2"
Resize will fit the image into the requested size. http://www.imagemagick.org/Usage/resize/#resize It does NOT fill, the requested box size.
As you can see a 64x64 square image was NOT produced by "-resize". In fact the images were only enlarged or reduced just enough so as to best fit into the given size.
So that Might be an issue.
Yup, and 250x250 assumes all images are the same size (well, that you want them to be the same size), and that's not the case.
I'll see how this works as well. Honestly, I'm following the steps of someone who converted the font before, but he did it all by hand, one glyph at a time (the font was a lot smaller then).
That's good stuff though, I really should have paid more attention in maths...
That's good information, the problem is that the images are not the same size. I need them to scale, and to do that with this method would require calculating the size manually, one by one.
Thank you for this however, it might be very helpful for someone else!
Yes, I have the source files for the fonts that contain the glyphs, and I can export them in several formats. See the repo here.
Also, you can take a look at the issue that I linked to try and understand what we're doing (I really don't, I don't know anything about these things).
Basically creating a TrueType variant of a bitmap font, and then see if it works on Android.
For me xinput set-prop "device" "libinput Button Scrolling Button" 3 was all it took to get that behavior. Hold right button and move the pointing stick, you've got scrolling.
I was under the impression that information is exclusive for Lenovo's TrackPoint devices. Either way, I don't have a middle button for my pointing stick.
Thanks for trying though, a lot of people forget the wiki.
All of these things sound great to me. I have some programming experience, so I get what you mean by 'learning through creation'. What I meant by learning with Arch is that other mainstream distros don't really throw much problems for you to fix manually these days.
If you truly do have to setup Arch your own way, then you're going to have your very own problems, and finally, your own solutions.
That's working fine now, great job!
I have resized and made all images transparent already. Now to see if we can turn them to a .ttf
Once again, thanks a lot for everything!
This ended up being the one that did it! Distorted pretty hard, as you all pointed out, but they're 25x bigger.
Thank you!
Oh, okay. I assumed it was something image related. I didn't know about
parallel, I thought that all that was handled by the kernel...Yep, doing it manually works just fine.
I commented out these lines:
Then I replaced
"${nw}x${nh}"with"$((${mult}*100))%"it this line:The script ran! Here's an output example:
I don't know which one failed, but anyway the images scaled 2 times instead of twenty-five (the first one is 1x1, makes it easy to control). Also, each png was output to it's own subfolder in the destination directory. I'm guessing that's to do with this:
But the real kicker is: it seems all I was missing was the % argument for
mogrify -resize. I ranmogrify -resize 2500% *.pngand checked the size of a few output glyphs. It seems to have worked well!This was a big step forward, and your script helped me to understand how a lot of this works. It actually encouraged me to start something I've been pondering, which is to learn bash.
Thank you so much for all your time, really.
Ran into this:
The only thing I changed on the script was the shebang, to '/bin/sh', because I'm using zsh.
EDIT: This problem is not related to your script. It seems that the Imagemagick in the Arch repos doesn't come with the adequate libraries. I'll install imagemagick-full from the AUR and try again.
EDIT2: Nope, still:
So that Might be an issue.
Yup, and 250x250 assumes all images are the same size (well, that you want them to be the same size), and that's not the case.
This turned out more complicated than I thought.
I'll see how this works as well. Honestly, I'm following the steps of someone who converted the font before, but he did it all by hand, one glyph at a time (the font was a lot smaller then).
That's good stuff though, I really should have paid more attention in maths...
Holy crap, that looks amazing, I wasn't expecting anyone to go through this trouble!
I should be sleeping already, so I'll try it tomorrow, but I really had to stop by and thank you for your work!
Thank you!
250x250, basically multiplying height and width by 25.
I'm not judging, I didn't even know about this stuff up to last weekend, where I stubbornly decided I want my laptop font on my phone as well!
If anything, it's being a real learning experience.
This looks very complex, I will read the documentation carefully and experiment with it.
Thank you for your suggestion!
I'm sorry, what do you mean by "leverage all the cores"?
Thanks.
This is really great! I had no idea that this was even possible.
FOSS never ceases to amaze me.
Thank you!
That's good information, the problem is that the images are not the same size. I need them to scale, and to do that with this method would require calculating the size manually, one by one.
Thank you for this however, it might be very helpful for someone else!
Thank you, I will absolutely try this! Looks promising.
Thanks for taking the time!
This is what I'm having trouble with, actually. I do not know how to express "multiply these images size by 25".
I didn't know about the 'find' method, I look into it as well.
Also, from what I read, it seems like the 'convert' option is no longer current, the ImageMagick documentation suggests 'mogrify'.
Thank you for your reply, I appreciate it.
Yes, I have the source files for the fonts that contain the glyphs, and I can export them in several formats. See the repo here.
Also, you can take a look at the issue that I linked to try and understand what we're doing (I really don't, I don't know anything about these things).
Basically creating a TrueType variant of a bitmap font, and then see if it works on Android.
Thank you for your attention!
That would explain it. I wonder why they didn't write that in the post.
I haven't gotten the update yet. Guess it'll spice up my morning tomorrow.
For me
xinput set-prop "device" "libinput Button Scrolling Button" 3was all it took to get that behavior. Hold right button and move the pointing stick, you've got scrolling.It's in the article under two-button trackpoint.
Oh, that's fucking amazing! Thanks everybody, sorry if I came across as a help vampire, I really interpreted that as device specific...
I was under the impression that information is exclusive for Lenovo's TrackPoint devices. Either way, I don't have a middle button for my pointing stick.
Thanks for trying though, a lot of people forget the wiki.
Nah, if I'm going to go for it, I'm going for gold. But thanks for the suggestion!
All of these things sound great to me. I have some programming experience, so I get what you mean by 'learning through creation'. What I meant by learning with Arch is that other mainstream distros don't really throw much problems for you to fix manually these days.
If you truly do have to setup Arch your own way, then you're going to have your very own problems, and finally, your own solutions.
Yup, I'll man up about it.
Actually, I've read a lot of hindsight posts about this. It's definitely something I'll be keeping my eye on.