Unsolved License Plate Font Size

Discussion in 'Mod Support' started by Nico69, Mar 14, 2017.

  1. Nico69

    Nico69
    Expand Collapse

    Joined:
    Mar 1, 2017
    Messages:
    31
    So I figured out how to install the plates, and I am now making custom plates. Which value in the JSON iis the font height?
     
  2. thomatoes50

    thomatoes50
    Expand Collapse
    BeamNG Team

    Joined:
    Jan 31, 2013
    Messages:
    722
    If you just modified the texture file ( MOD_license_plate.json)
    "text" : { "x" : 0.5, "y" : 0.85, "scale" : 1, "color" : "white", "limit" : 12},

    If you are creating a new font (platfont.json)
    "char": [
    {
    "id": "45",
    "x": "0",
    "y": "0",
    "width": "56",
    "height": "115",

    "xoffset": "0",
    "yoffset": "0",
    "xadvance": "56",
    "page": "0",
    "chnl": "15"
    },
     
  3. Nico69

    Nico69
    Expand Collapse

    Joined:
    Mar 1, 2017
    Messages:
    31
    You mean the font itself can be changed? What does "char" represent? I have a great license plate font I would love to use.
     
  4. thomatoes50

    thomatoes50
    Expand Collapse
    BeamNG Team

    Joined:
    Jan 31, 2013
    Messages:
    722
    If you have special characters you should do a new font.
    If not you should just replace the original texture

    This is JSON, char is an array of objects

    the object is defined by the ID which is the decimal value of the character in the ascii table (45 = '-' dash)
    then all other properties are used to get where the uper-left and the size of the char is on the font texture
     
  5. Nico69

    Nico69
    Expand Collapse

    Joined:
    Mar 1, 2017
    Messages:
    31
    The only thing I am unclear of is, would the font file need to be added as a DDS as well? In other words, how would changing the value recognize it is a different font? Thank you for the information you have provided me so far. I really appreciate it.
     
  6. thomatoes50

    thomatoes50
    Expand Collapse
    BeamNG Team

    Joined:
    Jan 31, 2013
    Messages:
    722
    In the picture you will see that it's a modified font

    I reuse the same position of letter as the default font (note : it should be repeated because the first ones are minuscules)

    I have to add some special characters because french one have a logo and an area code at the end of the licence plate

    If you don't have any special things needed you can use the default font with a modded texture
    For a modded texture you can just change this
    Code:
                "diffuse" : {
                    "spriteImg" : "vehicles\common\licenseplates\MOD_license_plate\platefont_d.png",
    and then tweak the scale (in the json, try to have the same letter size)
     

    Attached Files:

    • platefont_d.png
  7. Nico69

    Nico69
    Expand Collapse

    Joined:
    Mar 1, 2017
    Messages:
    31
    How do I take a font file and convert it to a usable png?
     
  8. thomatoes50

    thomatoes50
    Expand Collapse
    BeamNG Team

    Joined:
    Jan 31, 2013
    Messages:
    722
    you can use any image editor I think (GIMP, paint.net, photoshop, Inkscape ....)
    If you have your font as a windows font you just replace the letters
    if all letters have the same width you can do it line by line
    else you will have to place all letter by hand

    I recommend using layers, this way you will know how to position the new letters
     
  9. Nico69

    Nico69
    Expand Collapse

    Joined:
    Mar 1, 2017
    Messages:
    31
    Thanks, I figured it out. At first mt spacing was off. Very time consuming but good end results. After all that I don't like the nine with the full curve so I'm changing it.:mad:
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice