Announcement

Collapse
No announcement yet.

FontParam details

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    FontParam details

    Hi,
    I am overlaying text into a number of images of various resolutions. I would like to be able to scale the text to a percentage of the image width.

    I have a vbs that uses the text file generated using
    Code:
    irfanview /info=textfile.txt
    to determine the height and width of the image.

    the first value in FontParam lets me change the font size, however I am unable to determine what the final text size will be.
    Do any of the other options in FontParam let you scale the output to a number of pixels wide and high? what do the other options mean?

    My ini file:
    Code:
    [BatchText]
    AddText=Test text
    TextCoord=151;807;768;1360
    Corner=0
    Orientation=0
    TranspText=0
    FontColor=16777215
    TxtBgkr=0
    FontParam=-105^|0^|0^|0^|400^|0^|0^|0^|0^|3^|2^|1^|18^|
    Font=Times New Roman
    [Batch]
    AdvAddText=1
    Thanks
    David

    #2
    The first parameter is the one you're interested in. It is the font size in pixels.

    12 points = 16 pixels
    72 points = 96 pixels etc.

    The others, as far as I can tell, are about the font style, underline, strikeout, etc. You can save the settings from the batch dialogue to check the values.
    Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

    Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

    Comment


      #3
      I can tell you only this:

      Code:
      FontParam=-13|0|0|0|700|0|0|0|0|1|2|1|49|
                 ^  ^ ^ ^  ^  ^ ^ ^ ^ ^ ^ ^ ^
                 A  B C D  E  F G H I J K L M
      A: Font size (Example: ”-13” = Size 10)
      B: (unknow function)
      C: (unknow function)
      D: (unknow function)
      E: Font style: ”400” = standard, ”700” = bold
      F: Font style: ”255” = italic
      G: Text decoration: Underline; ”0” = off, ”1” = on
      H: Text decoration: Line-through; ”0” = off, ”1” = on
      I: Font script (Western European, Arabic, Greek, etc.)
      J: (unknow function)
      K: (unknow function)
      L: (unknow function)
      M: (unknow function)


      I hope this will help.
      Last edited by Foxy; 30.07.2009, 06:09 PM.
      »Und so, in eurer Verzweiflung, kommt ihr zu mir.«

      Texteditor EmEditor:
      Deutsche Sprachdatei (v7.01) für EmEditor Pro 7.02 (englisch)
      EmEditor Pro 8.06 (deutsch) | Deutsche Sprachdatei (v8) für EmEditor Pro 8.06 (englisch)
      Deutsche Sprachdatei (v9.16) für EmEditor Pro 9.17 (englisch)

      Comment


        #4
        Parameter "I" is the script — Western is the default

        Orientation is the text alignment

        0 = Left
        1 = Centre
        2 = Right
        Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

        Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

        Comment


          #5
          Thanks for you answers, I am still looking into this.

          I have measured the number of pixels for various parameter A values using Times New Roman

          -105 = 72 pixels high, ratio 1:0.686
          -100 = 69 pixels high, ratio 1:0.69
          -72 = 50 pixels high, ratio 1:0.694
          -50 = 35 pixels high, ratio 1:0.7

          I could just use the ratio (parameter A)*0.7 to determine the height.

          I am not sure about how to determine the with of font characters or the final width of my text string

          Comment


            #6
            If you use a fixed width font like Courier it is fairly easy to determine the size of the box to put it in.
            For example N characters of 60 point text require 80 pixels high by 48*N wide.

            If you want to use a variable width font like Times new Roman it is much more complicated though. This site describes a way to do it using VB.net but I have not come across a VB script equivalent.

            Comment


              #7
              Thanks for the link. I considered writing an app to return the width or height of a string, but decided against it.

              I have a small number of strings in this project so, I calculated the height-width ratio for each string and estimated the Irfanview Font Size as follows:

              Eg:
              Font = Times New Roman
              StringText = "OT000 M1"

              Manually measured Width:height = 465:72, ratio 1:0.155
              Manually measured IrfanviewFontSize -105 = 72 pixels high, ratio 1:0.686

              FontHeightPx= (DesiredWidthPx*0.155)
              IrfanviewFontSize=FontHeightPx/0.686

              Comment

              Working...
              X