Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

How to change the font of only numbers in a textframe?

$
0
0

I'm working to create a script that makes a textbox based on user input. I need a way to make it so any time a number is used, it uses a different font.

 

Here's what I'm working with so far

        var doc = app.activeDocument;

        var pItems = doc.activeLayer.pageItems;

        var text_frame_boxed =  doc.activeLayer.textFrames.add();

        text_frame_boxed.contents = text_box_text.text;

        text_frame_boxed.textRange.characterAttributes.size = font_size_letters; 

        text_frame_boxed.textRange.characterAttributes.textFont = app.textFonts.getByName(font_for_letters);

 

I need to search the contents for any numbers, and replace their characterAttributes (both size and textFont).


Viewing all articles
Browse latest Browse all 12845

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>