PHP Determining Font Size based off of width -


I have the fixed width of an element, and an unknown string length that is inserted by the user. I am trying to keep javascript out, otherwise this problem will be solved using the jQuery method described in other positions.

I am generating a static page with PHP which will not change and I am trying to calculate the size of the text to fit within the Div.

Is this just the following: string length - width of the container - server side with PHP

And can you please give me a hand to find the right solution?

Cheers

If this is about an HTML element, then you get 100 Can not set the width of PHP with% reliability You really have to find an element in the client browser, and it is possible that using javascript only.

  • Li>

  • The availability of fonts used on the client machine

    By manually defining the width of the element with a normal zoom, you can be the best (or if it is dynamic Text, maybe what a judge has been proposed)

  • Comments

    Popular posts from this blog

    qt - switch/case statement in C++ with a QString type -

    python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

    Python's equivalent for Ruby's define_method? -