Jump to content
  • Auto reduce font size to fit text field


    bradcobb
    CategoryFeature request
    PriorityHigh
    ReproducibilityN/A
    ResolutionFixed
    SeverityMinor
    StatusResolved

    Feature request to enable font size to be automatically reduced at report generation time to fit text to a fixed dimension text box (text retrieved from a data source).

     

     

    Note: My company is willing to sponsor this enhancement, subject to agreeable terms.



    User Feedback

    Recommended Comments

    Unfortunately at the moment it is the only solution, but it is so dirty.

    How can you calculate the style according to the length of the string? f.e. compare two strings with length 5:

    WWWWW

    lllll

    In rendered report this two strings in the same field will have totally different length.

    F.e. there is such project as List&Label and it has in textfield parameter fit: shrink, break, cut...

    Link to comment
    Share on other sites

    Changed Status from New to Feedback Requested


    Hi,If we are to implement such feature, there are some questions that need to be answered first.We are talking here about decreasing the font size so that the full text fits in the design time element size.But since the text value could be styled text and different chunks of text have different font size, I guess the issue is about decreasing the font size for all chunks using a ratio.So it is not about decreasing font size point by point, but rather decrease it with a ratio, especially considering that nowadays font size is no longer only integer values.This is a little bit tricky because I assume not all export formats support the same precision when it comes to font size, so in some cases we would need to truncate or round up non integer font size values, resulting in the original styled text chunks becoming disproportionate with each other.Thanks,Teodor
    Link to comment
    Share on other sites

    I agree. I would also like to see a feature for "fit", which scales it down OR up to use the available field space. Not sure it needs to super complicated, I'd personally be happy it it went integer value at a time to each font size iteratively until it fill the area. (I don't have mixed/styled text anyway)
    Link to comment
    Share on other sites

    Changed Assigned User from - to @teodord


    Hi,I think we can do something about it, but I suggest it always works by decreasing the font size. In cases people want the font size to grow so that text fits exactly, it is enough to start with a larger font size for the text field and fitting would work again by decreasing font size automatically. This way we don't have to introduce a special setting to differentiate between situations where increasing the font size is desirable or not.Thanks,Teodor
    Link to comment
    Share on other sites

    Changed Status from Feedback Requested to Assigned

    Changed Assigned User from - to @teodord


    Hi,Started to work on it. Hopefully, it will be available in one of the future releases this year.Thanks,Teodor
    Link to comment
    Share on other sites

    Changed Resolution from Open to Fixed

    Changed Status from Assigned to Resolved

    Changed Assigned User from - to @teodord


    Hi,This is implemented in master branch and will be part of the next release.The isStretchWithOverflow boolean attribute of text fields was deprecated and replaced with the enum attribute called textAdjust, with the following possible values: CutText, ScaleFont and StretchHeight.I hope this helps.Teodor
    Link to comment
    Share on other sites



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...