Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create diffs vs. origin typefaces with Chris Wendt's script #77

Open
chrissimpkins opened this issue Jun 29, 2015 · 4 comments
Open

Create diffs vs. origin typefaces with Chris Wendt's script #77

chrissimpkins opened this issue Jun 29, 2015 · 4 comments

Comments

@chrissimpkins
Copy link
Owner

Script by @chrismwendt located at https://github.com/chrismwendt/bront/blob/89785af894459275c571815dd0e352d0b892e712/render.sh

input="sample.txt"
size=100
declare -a bases=("UbuntuMono" "DejaVuSansMono")

for base in "${bases[@]}"
do
   echo "Rendering $input using $base..."

   convert +antialias -density 228 -fill red -font $base.ttf -pointsize $size label:@$input $base.png
   convert +antialias -density 228 -fill green -font $base-Bront.ttf -pointsize $size label:@$input $base-Bront.png
   convert $base-Bront.png $base.png -compose multiply -composite $base-comparison-large.png
   convert -resize 25% $base-comparison-large.png $base-comparison.png
   rm $base.png $base-Bront.png $base-comparison-large.png

   echo "Rendered $input to $base-comparison.png"
done

ImageMagick docs: http://www.imagemagick.org/script/convert.php

@linjer
Copy link

linjer commented Aug 19, 2015

Hey, I was going to check in on your overall progress and I saw this issue, so I wanted to point out the Google fonts repo has something that does a good job at this in the tools folder.

https://github.com/google/fonts

@chrismwendt
Copy link
Contributor

Are you referring to https://github.com/google/fonts/blob/master/tools/compare_font.py? Correct me if I'm wrong, but that script compares things like sizes of glyphs and supported subsets, and doesn't render any images.

The script in this issue renders image diffs like https://camo.githubusercontent.com/a1621cf63d7e06d5843e3b0704d85cbe4f4a96c4/687474703a2f2f692e696d6775722e636f6d2f555143376144512e706e67.

@linjer
Copy link

linjer commented Aug 20, 2015

Right. I don't mean to reference that tool as a competing item, but something you may draw from.

@chrissimpkins
Copy link
Owner Author

Thanks for the suggestion Jerry. I will check out the Google fonts repo to see what they have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants