• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Syntax help with hiCreateMLTextField

Stats

  • Replies 3
  • Subscribers 143
  • Views 744
  • Members are here 0

Syntax help with hiCreateMLTextField

psill00
psill00 1 month ago

What is the syntax or what font can I use with hiCreateMLTextField?

How do I set the value in the cdsint

Is there another way to have the print larger in the field?


Paul

  • Sign in to reply
  • Cancel
Parents
  • Aurel B
    Aurel B 1 month ago

    Hi Paul,

    Unfortunately the ?font argument exists but I've never seen it supported anywhere.

    If you do not intend to use a different font for inputs but only to display nice things, then you have more possibilities.

    Here is an example of HTML field that will display what you typed with bold colored sans-serif face:

    (hiDisplayForm
      (hiCreateLayoutForm (gensym 'custom_form) "Custom Form"
        (hiCreateFormLayout 'main_layout ?items (list
            (hiCreateMLTextField
              ?name 'text_field
              ?changeCB
              (lambda (_field form)
                ;; Update HTML field using typed value
                (setf form->html_field->value
                  (lsprintf "<font face='sans serif' size='+2' color='firebrick' ><b>%s</b></font>" form->text_field->value)
                  )
                t)
              )
            (hiCreateHypertextField
              ?name 'html_field
              )
            ))
        ))
    

    Hope this helps,
    Aurel

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • psill00
    psill00 1 month ago in reply to Aurel B

    Big thanks for reply

    The script has the font variability I want but it does not or I have not found how to get it to support return line.

    The MLtext works; I just want like it to be easier to read.

    Paul

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Aurel B
    Aurel B 1 month ago in reply to psill00

    This is an HyperText field, so the syntax is now HTML.

    Newlines are not supported as you expect but you can use HTML tags to get return lines : 

    You can for instance use <p>, <br/> or <pcre> for nice formatting of text and code.

    Here is an updated version of the previous example where input newlines are replaced by `<br/>` tags : 

    (hiDisplayForm
      (hiCreateLayoutForm (gensym 'custom_form) "Custom Form"
        (hiCreateFormLayout 'main_layout ?items (list
            (hiCreateMLTextField
              ?name 'text_field
              ?changeCB
              (lambda (_field form)
                ;; Update HTML field using typed value
                (setf form->html_field->value
                  (lsprintf "<font face='sans serif' size='+2' color='firebrick' ><b>%s</b></font>"
                    (buildString (parseString (hiEscapeHTMLTags form->text_field->value) "\n" t) "<br/>")
                    ))
                t))
            (hiCreateHypertextField
              ?name 'html_field
              )
            ))
        ))
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Aurel B
    Aurel B 1 month ago in reply to psill00

    This is an HyperText field, so the syntax is now HTML.

    Newlines are not supported as you expect but you can use HTML tags to get return lines : 

    You can for instance use <p>, <br/> or <pcre> for nice formatting of text and code.

    Here is an updated version of the previous example where input newlines are replaced by `<br/>` tags : 

    (hiDisplayForm
      (hiCreateLayoutForm (gensym 'custom_form) "Custom Form"
        (hiCreateFormLayout 'main_layout ?items (list
            (hiCreateMLTextField
              ?name 'text_field
              ?changeCB
              (lambda (_field form)
                ;; Update HTML field using typed value
                (setf form->html_field->value
                  (lsprintf "<font face='sans serif' size='+2' color='firebrick' ><b>%s</b></font>"
                    (buildString (parseString (hiEscapeHTMLTags form->text_field->value) "\n" t) "<br/>")
                    ))
                t))
            (hiCreateHypertextField
              ?name 'html_field
              )
            ))
        ))
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information