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

Define unit of row height #426

Merged
merged 1 commit into from
May 17, 2024
Merged

Define unit of row height #426

merged 1 commit into from
May 17, 2024

Conversation

johnfercher
Copy link
Owner

@johnfercher johnfercher commented May 17, 2024

Description

  • Define unit of row height in documentation.

Related Issue

#420
#386

Checklist

check with "x", ONLY IF APPLIED to your change

  • All methods associated with structs has func (<first letter of struct> *struct) method() {} name style.
  • Wrote unit tests for new/changed features.
  • Followed the unit test when,should naming pattern.
  • All mocks created with m := mocks.NewConstructor(t).
  • All mocks using m.EXPECT().MethodName() method to mock methods.
  • Updated docs/doc.go and docs/*
  • Updated example_test.go
  • Updated README.md
  • Executed make examples to update all examples inside docs/examples.
  • New public methods/structs/interfaces has comments upside them explaining they responsibilities
  • Executed make dod with none issues pointed out by golangci-lint

@johnfercher johnfercher merged commit 074ffd7 into master May 17, 2024
5 checks passed
@johnfercher johnfercher deleted the feature/row-height-doc branch May 17, 2024 16:21
Copy link

@lordofscripts lordofscripts left a comment

Choose a reason for hiding this comment

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

I know FPDF's initialization allows the user/programmer to specify the units of measurements: points, millimeter, inches, etc. That applies during the object instance lifetime.

I don't know if Maroto only allows millimeter (fine by me), or also allows the flexibility of a choice. I mention it because the updated document clarifies that the unit of row height is millimeters.

FPDF is sort of a low-level library. Maroto builds on top of it to isolate the user from the quirks of low-level stuff. I don't see which criteria was used to not shield the user from this ☹️. My reasoning is below:

  • Under normal circumstances (text output), a row is composed of one or more lines (n × L), and,
  • every line of text has a known font height, and if several fonts used, the height would be dictated by the largest (L).
  • if the row is a graphical element such as an image or a code, then the row height would be dictated by image.Height.

Therefore I think that Maroto could easily calculate that internally as components are added to Col and these in turn to Row.

So, maybe it could be something to consider for the future Maroto/v3 as I guess it is too late for both v1 & V2.

Anyway, just an idea

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