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

python printSample waterfall is empty #3457

Closed
4 of 5 tasks
fovea1959 opened this issue Feb 8, 2019 · 2 comments
Closed
4 of 5 tasks

python printSample waterfall is empty #3457

fovea1959 opened this issue Feb 8, 2019 · 2 comments

Comments

@fovea1959
Copy link

When reporting a bug/issue:

  • Screenshot
    image

  • The FontForge version and the operating system you're using
    Ubuntu 18.04

Copyright (c) 2000-2014 by George Williams. See AUTHORS for Contributors.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
 Based on sources from 11:21 UTC 24-Sep-2017-ML-D.
 Based on source from git with hash: 
no xdefs_filename!
TESTING: getPixmapDir:/usr/share/fontforge/pixmaps
TESTING: getShareDir:/usr/share/fontforge
TESTING: GResourceProgramDir:/usr/bin
trying default theme:/usr/share/fontforge/pixmaps/resources
fontforge 11:21 UTC 24-Sep-2017
libfontforge 20170924
  • The behavior you expect to see, and the actual behavior
    The Python printSample() won't print waterfall, you just get a header line.
  • Steps to reproduce the behavior
    run this script, look at waterfall.pdf
import fontforge

amb = fontforge.open('FXMatrix105MonoComprExpDblULSubItalic.sfd')
fontforge.printSetup('pdf-file', 'z.pdf')
amb.printSample('fontdisplay', 24, 'abcdefABCDEF', 'fontdisplay.pdf')
amb.printSample('waterfall', (12, 16, 24, 36), 'abcdefABCDEF', 'waterfall.pdf')
amb.printSample('fontsample', 24, 'abcdefABCDEF', 'fontsample.pdf')

Input file and sample output are attached (output is shown above).

waterfall.pdf

FXMatrix105MonoComprExpDblULSubItalic.zip

  • (optional) Possible solution/fix/workaround
@ctrlcctrlv
Copy link
Member

The reason this is happening is you haven't selected the letters first. Try:

import fontforge
amb = fontforge.open('FXMatrix105MonoComprExpDblULSubItalic.sfd')
fontforge.printSetup('pdf-file', 'z.pdf')
amb.selection.select(("unicode","ranges"),ord('A'),ord('Z'))
amb.printSample('waterfall', (12, 16, 24, 36), 'abcdefABCDEF', 'waterfall.pdf')

@fovea1959
Copy link
Author

ah! that works, thank you for the clear and accurate answer.

I was looking a quick way to do "The quick brown fox jumps over the lazy dog. " style sheets; looks like I'll need to try something else.

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

No branches or pull requests

2 participants