Grow your CSS skills. Land your dream job.

Font letter image replacement per-letter

  • # May 18, 2012 at 6:11 pm

    I’m working on solving a letter replacement problem. Have full-color images that need to replace each letter for a header. I would like it to be a sprite for performance. My current solution is use PHP to shift the background(sprite) based on the ascii value of the letter and assign a class that will set the width based on the pixel width of the rendered letter. The width will be set in an array for each letter by hand. This won’t be monospaced.

    I’m wondering if someone has already solved this problem. It would be lots easier to make the letters separate images and just create image elements with the ascii character value as part of the name(so I can use special characters).

    so:
    one image (or part of a sprite) per letter.
    An alternate font doesn’t work because the replacement letters are images of 3d letters and not vector at all.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".