Skip to content

Including exception regarding missing FONTBOUNDINGBOX parameter #43

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

Merged
merged 2 commits into from
Apr 20, 2021
Merged

Including exception regarding missing FONTBOUNDINGBOX parameter #43

merged 2 commits into from
Apr 20, 2021

Conversation

jposada202020
Copy link
Contributor

@jposada202020 jposada202020 commented Apr 3, 2021

Including exception regarding missing FONTBOUNDINGBOX parameter in the font file.

Will produce

Exception: Font does not have the FONTBOUNDINGBOX property. Try a different font

Solves #25

@jposada202020
Copy link
Contributor Author

This was tested manually removing the FONTBOUNDINGBOX line in a bdf font file. Thanks!

@tannewt tannewt requested a review from jepler April 5, 2021 16:46
Copy link
Contributor

@jepler jepler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a font can't .get_bounding_box(), are there other uses for it?

If not, why don't we handle this oddity in the constructor instead of here, by rejecting the font when it is first opened.

@jposada202020
Copy link
Contributor Author

I do not think the font should be used. So answer will be no.

Just for reference: .get_bounding_box() is used in:

bitmap_label

in the _line_spacing_ypixels function

label

To define the height in self.height

Not sure why there is this difference, but I agree with you to handle it in the constructor. Thanks I will work on that and Re-submit

@jposada202020
Copy link
Contributor Author

@jepler Chages were made. Two things:
A new attribute is created. This way it could be call in the future by the Text libraries (modification will be needed). However would works as you can see in the new get_bounding_box()
We still need to parse the first lines of code and get the value, so I create a new function not to put a lot of lines in the __init__ this is a design choice, but all the code could be done at __init__. Just my preference, open to change if wanted.

@jposada202020
Copy link
Contributor Author

Hey @jepler , this probably got lost in your inbox, but if you could review the requested changes when you get a chance, that would be great

Copy link
Contributor

@jepler jepler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Sorry I let this languish.

@jepler jepler merged commit 5d6ecb1 into adafruit:master Apr 20, 2021
@jposada202020 jposada202020 deleted the raise_error_no_boundingbox branch April 20, 2021 21:34
@jposada202020
Copy link
Contributor Author

😃 Thanks

adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Apr 30, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_ADXL34x to 1.11.8 from 1.11.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_ADXL34x#29 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_APDS9960 to 2.2.7 from 2.2.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_APDS9960#29 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_AS726x to 2.0.5 from 2.0.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_AS726x#16 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_BNO055 to 5.3.1 from 5.3.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_BNO055#81 from jposada202020/improving_docs
  > Merge pull request adafruit/Adafruit_CircuitPython_BNO055#80 from GuenterQ/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_FXAS21002C to 2.1.8 from 2.1.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_FXAS21002C#22 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_FXOS8700 to 2.1.7 from 2.1.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_FXOS8700#23 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_GPS to 3.9.0 from 3.8.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_GPS#62 from lesamouraipourpre/minimum_sentence_size
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_ICM20X to 2.0.7 from 2.0.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_ICM20X#12 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_L3GD20 to 2.3.5 from 2.3.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_L3GD20#22 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS2MDL to 2.1.9 from 2.1.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_LIS2MDL#13 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS331 to 1.0.5 from 1.0.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_LIS331#3 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH to 5.1.10 from 5.1.9:
  > Merge pull request adafruit/Adafruit_CircuitPython_LIS3DH#68 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS3MDL to 1.1.10 from 1.1.9:
  > Merge pull request adafruit/Adafruit_CircuitPython_LIS3MDL#16 from jposada202020/master
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM303_Accel to 1.1.7 from 1.1.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_LSM303_Accel#11 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM303DLH_Mag to 1.1.8 from 1.1.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_LSM303DLH_Mag#13 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM9DS1 to 2.1.8 from 2.1.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_LSM9DS1#29 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_MLX90393 to 2.0.6 from 2.0.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_MLX90393#28 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_MMA8451 to 1.3.7 from 1.3.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_MMA8451#17 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_MPU6050 to 1.1.7 from 1.1.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_MPU6050#16 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_MSA301 to 1.2.7 from 1.2.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_MSA301#15 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_TCS34725 to 3.3.7 from 3.3.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_TCS34725#35 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_TLC59711 to 2.0.0 from 1.2.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_TLC59711#17 from jposada202020/master
  > Merge pull request adafruit/Adafruit_CircuitPython_TLC59711#5 from s-light/multi
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_VCNL4010 to 0.10.8 from 0.10.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_VCNL4010#18 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_VCNL4040 to 1.2.6 from 1.2.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_VCNL4040#13 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT to 2.4.0 from 2.3.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_AzureIoT#31 from jimbobbennett/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bitmap_Font to 1.5.0 from 1.4.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_Bitmap_Font#46 from jposada202020/master
  > Merge pull request adafruit/Adafruit_CircuitPython_Bitmap_Font#43 from jposada202020/raise_error_no_boundingbox
  > Merge pull request adafruit/Adafruit_CircuitPython_Bitmap_Font#45 from FoamyGuy/simpletest_example

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Shapes to 2.1.0 from 2.0.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Shapes#37 from jposada202020/new_example_circle
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Shapes#36 from empirical-dan/patch-2

Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout to 1.9.2 from 1.9.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_Layout#36 from jposada202020/solving_parameters
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

Successfully merging this pull request may close these issues.

2 participants