add extra small field font size
This commit is contained in:
@@ -5,6 +5,10 @@
|
||||
if (this.field.scrollHeight > this.field.clientHeight) {
|
||||
this.field.classList.remove('text-[1.5vw]', 'lg:text-base');
|
||||
this.field.classList.add('text-[1.0vw]', 'lg:text-[0.70rem]');
|
||||
|
||||
if (this.field.scrollHeight > this.field.clientHeight) {
|
||||
this.field.classList.add('text-[0.8vw]', 'lg:text-[0.50rem]');
|
||||
}
|
||||
}
|
||||
}
|
||||
get field() {
|
||||
|
||||
@@ -209,6 +209,16 @@ module Submissions
|
||||
box_height = lines.sum(&:height)
|
||||
end
|
||||
|
||||
if box_height > (area['h'] * height) + 1
|
||||
text = HexaPDF::Layout::TextFragment.create(value,
|
||||
font: pdf.fonts.add(FONT_NAME),
|
||||
font_size: (font_size / 1.9).to_i)
|
||||
|
||||
lines = layouter.fit([text], field['type'].in?(%w[date number]) ? width : area['w'] * width, height).lines
|
||||
|
||||
box_height = lines.sum(&:height)
|
||||
end
|
||||
|
||||
height_diff = [0, box_height - (area['h'] * height)].max
|
||||
|
||||
right_align_x_adjustment =
|
||||
|
||||
Reference in New Issue
Block a user