[10 Apr 2011] Where write the doubts

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
User avatar
Juan Carlos
Posts: 932
Joined: Mon Sep 06, 2010 1:02 pm

[10 Apr 2011] Where write the doubts

Post by Juan Carlos »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 10 Apr 2011 20:56:19 +0100 (BST)

Hello Andreas, is very easy this question, where write the doubts? in this mail list in the forum or in both, because the questions where are better answers and fast?

Best regards and I have a doubt the next:

I want show text lines with the effect that the text is write alone with this routine:

Code: Select all

   Frase2Size= StrLen("by Juan Carlos Herrán Martín")
   Ejex=160
   For Numero=0 To Frase2Size
      TextOut(Ejex, 70, Chr(Frase2$[Numero]),WordWrap=2)
      Wait(5)
      Ejex=Ejex+10
   Next
Every letter is write with a new x position (I had it in C++, and it worked) but here with Hollywood the spaces are more big and the capital letters are showed overwriten the side letters, some solution or idea?
User avatar
airsoftsoftwair
Posts: 5833
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[15 Apr 2011] Re: Where write the doubts

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 15 Apr 2011 12:37:51 +0200
Hello Andreas, is very easy this question, where write the doubts? in this mail list in the forum or in both, because the questions where are better answers and fast?
Not in both. Either here or in the forums.
Best regards and I have a doubt the next:

I want show text lines with the effect that the text is write alone with this routine:

Code: Select all

  Frase2Size= StrLen("by Juan Carlos Herrán Martín")
  Ejex=160
  For Numero=0 To Frase2Size
     TextOut(Ejex, 70, Chr(Frase2$[Numero]),WordWrap=2)
     Wait(5)
     Ejex=Ejex+10
  Next
Every letter is write with a new x position (I had it in C++, and it worked) but here with Hollywood the spaces are more big and the capital letters are showed overwriten the side letters, some solution or idea?
You have to use TextExtent() to find the real extents of a character for proportional fonts. Simply increasing the x offset by 10 is only going to work for fonts where every character has the same width. This is not the case for most fonts.

The text stuff is not so easy because you'll also have to deal with underhangs and overhangs (for example the j character has an underhang and the T character usually has an overhang etc.). This can get quite complicated. Have fun nevertheless :)
Locked