Click here to Skip to main content
15,897,891 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralWSO CCC OTD 2021-07-13 Pin
OriginalGriff12-Jul-21 21:33
mveOriginalGriff12-Jul-21 21:33 
GeneralRe: WSO CCC OTD 2021-07-13 Pin
pkfox12-Jul-21 22:13
professionalpkfox12-Jul-21 22:13 
GeneralRe: WSO CCC OTD 2021-07-13 Pin
OriginalGriff12-Jul-21 22:41
mveOriginalGriff12-Jul-21 22:41 
GeneralRe: WSO CCC OTD 2021-07-13 Pin
DerekT-P12-Jul-21 22:41
professionalDerekT-P12-Jul-21 22:41 
GeneralRe: WSO CCC OTD 2021-07-13 We have a winner! Pin
OriginalGriff12-Jul-21 23:13
mveOriginalGriff12-Jul-21 23:13 
GeneralRe: WSO CCC OTD 2021-07-13 We have a winner! Pin
DerekT-P12-Jul-21 23:18
professionalDerekT-P12-Jul-21 23:18 
GeneralRe: WSO CCC OTD 2021-07-13 We have a winner! Pin
OriginalGriff12-Jul-21 23:23
mveOriginalGriff12-Jul-21 23:23 
QuestionLaying out text is *really* difficult Pin
honey the codewitch12-Jul-21 15:06
mvahoney the codewitch12-Jul-21 15:06 
I guess I'll never look down on typesetting as a profession. There's way more to it than I ever expected going into this.

I've laid out code to print "Hello World!" using a truetype font and all is well and good except that the letters can extend outside of their bounding positions. This means a font's glyph, when drawn starting at point (0,0) may extend to (-4,-3) for example. This makes positioning text kind of ... not so straightforward.

What I do with the overhang? Do I allow you to draw outside the destination rectangle? That creates a number of issues. I think I need margins. I hate that I need margins, but I think i need margins.

What if you can layout text within a bounding rectangle, and within that bounding rectangle there are margins? Your text starts at where the margins indicate but parts of the individual glyphs may extend into the margins depending on the font.

Does that make sense to people here? Can any of you think of a better way to handle the problem?

Did how I describe it even make sense?

Edit: I've forgone margins in lieu of a simple offset. The margins will be handled at a higher level.

Thanks all for being my rubber duck (again)
Real programmers use butterflies


modified 13-Jul-21 3:44am.

AnswerRe: Laying out text is *really* difficult Pin
Peter_in_278012-Jul-21 16:14
professionalPeter_in_278012-Jul-21 16:14 
GeneralRe: Laying out text is *really* difficult Pin
honey the codewitch12-Jul-21 17:45
mvahoney the codewitch12-Jul-21 17:45 
AnswerRe: Laying out text is *really* difficult Pin
David O'Neil12-Jul-21 16:15
professionalDavid O'Neil12-Jul-21 16:15 
GeneralRe: Laying out text is *really* difficult Pin
honey the codewitch12-Jul-21 17:47
mvahoney the codewitch12-Jul-21 17:47 
AnswerRe: Laying out text is *really* difficult Pin
Jörgen Andersson12-Jul-21 22:04
professionalJörgen Andersson12-Jul-21 22:04 
GeneralRe: Laying out text is *really* difficult Pin
honey the codewitch12-Jul-21 23:30
mvahoney the codewitch12-Jul-21 23:30 
GeneralRe: Laying out text is *really* difficult Pin
Jörgen Andersson12-Jul-21 23:52
professionalJörgen Andersson12-Jul-21 23:52 
GeneralRe: Laying out text is *really* difficult Pin
honey the codewitch13-Jul-21 0:24
mvahoney the codewitch13-Jul-21 0:24 
GeneralRe: Laying out text is *really* difficult Pin
Jörgen Andersson13-Jul-21 1:40
professionalJörgen Andersson13-Jul-21 1:40 
GeneralRe: Laying out text is *really* difficult Pin
honey the codewitch13-Jul-21 1:40
mvahoney the codewitch13-Jul-21 1:40 
GeneralRe: Laying out text is *really* difficult Pin
Jörgen Andersson13-Jul-21 1:44
professionalJörgen Andersson13-Jul-21 1:44 
GeneralRe: Laying out text is *really* difficult Pin
honey the codewitch13-Jul-21 1:45
mvahoney the codewitch13-Jul-21 1:45 
GeneralRe: Laying out text is *really* difficult Pin
Jörgen Andersson13-Jul-21 2:22
professionalJörgen Andersson13-Jul-21 2:22 
AnswerRe: Laying out text is *really* difficult Pin
Maximilien12-Jul-21 23:29
Maximilien12-Jul-21 23:29 
GeneralRe: Laying out text is *really* difficult Pin
honey the codewitch12-Jul-21 23:47
mvahoney the codewitch12-Jul-21 23:47 
AnswerRe: Laying out text is *really* difficult Pin
Gary R. Wheeler13-Jul-21 7:09
Gary R. Wheeler13-Jul-21 7:09 
GeneralWorld's deepest pool with underwater exploration. Pin
Slacker00712-Jul-21 9:04
professionalSlacker00712-Jul-21 9:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   347 votes