Bug #22399

Gifbuilder using breakWidth/breakSpace: lineHeight depends on rendered text

Added by Harald Glaser over 11 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Image Generation / GIFBUILDER
Target version:
-
Start date:
2010-04-08
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

When using breakWidth (and optionally breakSpace), the lineheight depends on the text which is rendered.
So generating 2 multi-line texts with completely identical settings may yield different results, e.g. when only one of the two strings contains characters with descenders (see attached example).
In my opinion, the lineheight for multiline text should not depend on the boundingbox of the given characters, but should depend on the configuration (font face, font size) - that's what we are used to.

(issue imported from #M14033)


Files

gifbuilder_lineheight.gif (6.01 KB) gifbuilder_lineheight.gif Administrator Admin, 2010-04-08 16:05
14033_breakSpaceFixed_trunk.diff (650 Bytes) 14033_breakSpaceFixed_trunk.diff Administrator Admin, 2010-04-19 19:50

Related issues

Related to TYPO3 Core - Feature #20164: Integrate automatic line breaks in GIFBUILDERClosedOliver Hader2009-03-11

Actions
#1

Updated by Ron Hall over 11 years ago

Yes. I have discovered the same issue. It creates a real problem with graphic headlines. Right now I am creating a copy of the font file, editing it and adding invisible descenders to the upper and lower case vowels. This makes GIFBUILDER calculate the line heights consistently, but is an awkward workaround.

It would be great as noted by Harald to have GIFBUILDER calculate the same height regardless of whether there are descenders or not.

Even better would be a property for specifying custom line heights as the default line height of a font is not always optimum.

#2

Updated by Harald Glaser over 11 years ago

As a workaround I have XClasses GifBuilder and added a new property "breakSpaceFixed", which is used as a fixed line height when set.

I will try to compile a .diff-file and post it as soon as I find some time...

#3

Updated by Harald Glaser over 11 years ago

I just uploaded a patch (compiled against trunk, but also tested with 4.3.3).
It adds the property "breakSpaceFixed" to "text"-objects in Gifbuilder, which - if set - overrides the calculated line height.

Example usage (line height is set to 16px):

file = GIFBUILDER
file {
10 = TEXT
10.text.field = title
10.breakWidth = 150
10.breakSpaceFixed = 16
}

#4

Updated by Kim Lang over 10 years ago

When i used big Letters with German Umlauts the same problem appears

#5

Updated by Kim Lang over 10 years ago

the patch doesn't work with the "niceText" option

#6

Updated by Jan Kornblum over 8 years ago

  • Target version deleted (0)

Are there any news regarding this?

#7

Updated by Mathias Schreiber over 6 years ago

  • Description updated (diff)
  • Target version set to 7.2 (Frontend)
  • Is Regression set to No
#8

Updated by Benni Mack over 6 years ago

  • Target version changed from 7.2 (Frontend) to 7.4 (Backend)
#9

Updated by Susanne Moog about 6 years ago

  • Target version changed from 7.4 (Backend) to 7.5
#10

Updated by Benni Mack about 6 years ago

  • Target version changed from 7.5 to 7 LTS
#11

Updated by Mathias Schreiber almost 6 years ago

  • Target version deleted (7 LTS)
#12

Updated by Riccardo De Contardi almost 6 years ago

  • Category set to Image Cropping
#13

Updated by Susanne Moog almost 4 years ago

  • Category changed from Image Cropping to Image Generation / GIFBUILDER
#14

Updated by Tymoteusz Motylewski over 3 years ago

  • TYPO3 Version changed from 4.3 to 9
  • PHP Version deleted (5.2)

here is the code to reproduce it on current master:
The attached patch worked (also with nice text set to 1 on current master)

page = PAGE
page.10 = TEXT
page.10.value = HELLO WORLD!
page.20 = IMAGE
page.20 {
  XY = 200,100
  file = GIFBUILDER
  file {
    width = 200
    height = 100
    backColor = black
    10 = TEXT
    10.fontColor = white
    10.text = Kuturelle & Soziale Aktivitat
    10.fontSize = 15
    10.niceText = 1
    10.align = left
    10.offset = 20,20
    10.breakWidth = 150
    10.lineHeight = 25
  }
}
page.30 = IMAGE
page.30 {
  XY = 200,100

  file = GIFBUILDER
  file {
    width = 200
    height = 100
    backColor = black
    10 = TEXT
    10.fontColor = white
    10.text = Mitarbeiter - Fundament des Erfolgs
    10.fontSize = 15
    10.niceText = 1
    10.align = left
    10.offset = 20,20
    10.breakWidth = 150
    10.lineHeight = 25
  }
}

#15

Updated by Tymoteusz Motylewski over 3 years ago

  • Related to Feature #20164: Integrate automatic line breaks in GIFBUILDER added
#16

Updated by Gerrit Code Review over 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56327

#17

Updated by Gerrit Code Review over 3 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56330

#18

Updated by Tymoteusz Motylewski over 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#19

Updated by Benni Mack almost 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF