Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: rand0m on February 04, 2019, 01:06:17 PM

Title: Easy way of forcing Uppercase text
Post by: rand0m on February 04, 2019, 01:06:17 PM
I found an easy way to utilize uppercase characters for things like [Title], [Overview] etc. Right now the goto methods are:



I found another way to do the needful, there is an app "fontforge" for creating and editing fonts. Make a copy of font you are using in theme (e.g. Ariel Medium), open the copy in fontforge. Now select and delete the small letters (a -z), copy capital letters (A - Z) and paste them in place of small letters. Go to generate font and save the file naming it something like Ariel Medium Uppercase (save as true type i.e. TTF) . Use this font in places where you want text in all capitals and place it in /layout dir. Couple of things:


Links:
Github: https://fontforge.github.io/en-US/
Sourceforge: https://sourceforge.net/projects/fontforge/

Select & Clear lowercase:
(https://i.imgur.com/rTc6a3u.png)

Select & Paste Uppercase in-place of lowercase:
(https://i.imgur.com/4zZACkv.png)

Original Source (ctrlcctrlv 's post): https://github.com/fontforge/fontforge/issues/2418
Title: Re: Easy way of forcing Uppercase text
Post by: keilmillerjr on February 04, 2019, 01:53:46 PM
Magic function and then return toupper(string); Not hard.
Title: Re: Easy way of forcing Uppercase text
Post by: Bgoulette on February 04, 2019, 03:15:58 PM
I wrote a function to "re-sanitize" titles when using magic tokens:

Code: [Select]
function getTitle (ioffset = 0) {
    // Working from the raw title, we have to cut away any extra junk:
    local _t = fe.game_info( Info.Title, ioffset );
   
    // Ignore anything after the first (, [, or /:
    local _i = null;
    _i = _t.find( "(" );
    _t = _i ? _t.slice( 0, _i ) : _t;

    _i = _t.find( "[" );
    _t = _i ? _t.slice( 0, _i ) : _t;

    _i = _t.find( "/" );
    _t = _i ? _t.slice( 0, _i ) : _t;
 
    return strip(_t).toupper();
}
Title: Re: Easy way of forcing Uppercase text
Post by: keilmillerjr on February 04, 2019, 04:32:08 PM
I wrote a function to "re-sanitize" titles when using magic tokens:

Code: [Select]
function getTitle (ioffset = 0) {
    // Working from the raw title, we have to cut away any extra junk:
    local _t = fe.game_info( Info.Title, ioffset );
   
    // Ignore anything after the first (, [, or /:
    local _i = null;
    _i = _t.find( "(" );
    _t = _i ? _t.slice( 0, _i ) : _t;

    _i = _t.find( "[" );
    _t = _i ? _t.slice( 0, _i ) : _t;

    _i = _t.find( "/" );
    _t = _i ? _t.slice( 0, _i ) : _t;
 
    return strip(_t).toupper();
}

split(string, "(/[");
Title: Re: Easy way of forcing Uppercase text
Post by: Bgoulette on February 05, 2019, 04:19:20 AM
split(string, "(/[");

Yeah, that's much better! Now I have some updates to make...