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

Font/Line size changes with calibration #5

Open
demisjohn opened this issue Jan 16, 2016 · 1 comment
Open

Font/Line size changes with calibration #5

demisjohn opened this issue Jan 16, 2016 · 1 comment

Comments

@demisjohn
Copy link
Owner

Since font/line size is a pixel value, sometimes the settings file draws the text way too small/too large.

It might make sense to have a calibration also have it's own font/line settings.

If so, I'd make the font/line settings be picked up by the name of the calibration, for ease of programming the user-settings file.

Eg.

Cal_Names = ['FluoroScope 5x', 'FluoroScope 10x', 'Fluoroscope 100x', 
        'JEOL SEM 2800x', 'JEOL SEM 50000x']

LineSize_default = 10.0
FontSize_default = 12.0

LinesSize_custom = [  ]   # initialize the list
LineSize_custom.append(   ['FluoroScope 5x', 14.0]  )    # like a key-value pair
LineSize_custom.append(   ['FluoroScope 10x', 14.0]  )
LineSize_custom.append(   ['FluoroScope 100x', 14.0]  )
LineSize_custom.append(   ['JEOL SEM 2800x', 28.0]  )
LineSize_custom.append(   ['JEOL SEM 50000x', 28.0]  )
@demisjohn
Copy link
Owner Author

demisjohn commented Apr 3, 2018

Saw that some commercial software does this by specifying font & linewidth as a Percentage/Fraction of the image size! Brilliant.

So that way regardless of your image’s width or resolution, font would always take up the same space if image was scaled to the screen size. Only need one size that applies to all calibrations.

Example, totally guessing on the function names/args:

FontSize = 0.05   # 5% of the image height
LineWidth = 0.001  # 0.1% of the image height

#draw the line:
draw_Line(  thickness = ImageHeight * LineWidth )

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

1 participant