[F/OS] ๐ŸŽจ Font Typeface - Set Fonts For Your Components Dynamically

:computer: Introduction

A non-visible extension that sets a visible component's font dynamically. You can choose between Serif, Sans Serif, Monospace or Default.

:package: Package name: com.gordonlu.fonttypeface.aix

:clock1: Version: 1

:date: Release date: 2022-03-11T02:00:00Z

If you want options beyond this, you can use MyFonts by @Anke.

If you just want to set it to these four options, OK, you can use this.

:ticket: Tested components

  • User Interface: Button, Checkbox, DatePicker, Label, ListPicker, PasswordTextBox, Switch, TextBox, TimePicker.

  • Media: ImagePicker

  • Social: ContactPicker, EmailPicker, PhoneNumberPicker

:open_book: Documentation

Method blocks

SetFontTypeface

image

Sets the font typeface of the TextBox, including whether to bold, italicize, and the font of the TextBox. Use the blocks in the properties of this extension for the font parameter. If useCurrentFont is true, the font parameter will be ignored.

Some components have properties to set bold or italic. If you want to keep them, but change the typeface, it is OK.

Parameters: component - component, bold = boolean, italic = boolean, font = text, useCurrentFont = boolean

Property blocks

DefaultFont

image

A font block.

Returns: "DEFAULT"

Monospace

image

A font block.

Returns: "MONOSPACE"

SansSerif

image

A font block.

Returns: "SANS SERIF"

Serif

image

A font block.

Returns: "SERIF"

:construction_worker_man: Open Source

Yes, this extension is open source! View it in GitHub.

:inbox_tray: Downloads

AIX: com.gordonlu.fonttypeface.aix (6.9 KB)

:+1: Rate my extension! :-1:

  • Good extension!
  • Bad extension.
0 voters

Made with Niotron IDE.

Kindly :email: PM me if you have any questions! Also, if you like my extension, please :heart: like it! It takes some effort for me to make it...

Votes and likes tell me the general user feedback of my extension. If you read this extension, please take 20 seconds to drop by and give a vote / like!

If you have any features that you want to add and you know the code, PM me or directly reply below using the image button.

8 Likes

Hi Gordon

Is there anything this extension can do that I can't already do with App Inventor's existing blocks?

  • For FontTypeface, I haven't (yet) seen blocks to set this for the built-in system.

  • For FontBold and FontItalic, some components have the set FontBold blocks, such as Button, but some do not, such as TextBox. Here is a list:

For all components that have the FontBold/FontItalic blocks (7)

  • User Interface: Button, DatePicker, ListPicker, TimePicker.

  • Media: ImagePicker

  • Social: ContactPicker, PhoneNumberPicker

For all components that do not have the FontBold/FontItalic blocks (6)

  • User Interface: Checkbox, Label, PasswordTextBox, Switch, TextBox.

  • Social: EmailPicker.

All "Buttons" have the FontBold and FontItalic features, while all "TextBoxes", Check boxes and Switches do not.

Some of the most popular components, e.g., Label, TextBox, do not have the function to settle FontBold, FontItalic and FontTypeface natively, so I made this extension.

2 Likes

This extension adds storage permission in manifest or not?

No, why would it add permission in Manifest? It is just an extension to set the font among 4 options, which is in the Android class Typeface, so it does not acces the storage system.

You can always go to GitHub and review the source code of the extension. No libraries, no extra permissions, only the 4 built-in fonts.

Ok thank you was asking coz myfonts adds storage permission to manifest.

Yes but with MyFonts extension you can add any custom font instead with this extension you only have the ability to set properties for default fonts used by MIT App Inventor from blocks

3 Likes

But that permission is useless when I upload my font in assets

There are a lot of types of "Serif" fonts online that you can find. The "Serif" block in this extension uses the default Serif font of Android. The "Serif" font sets this property dynamically, because currently, there is not a feature to do this.

image

2 Likes

Well of course they can be via the Designer palette, you mean they do not have the same attribute settings via Blocks, so your extension is fixing that anomaly.

3 Likes

This extension allows the developer to set some basic font settings via Blocks for individual Components. Works well in my test, on App Inventor nb188a.

1 Like

It only supports these components because technically, these components are all "TextView"s (they are all sub-classes of the android.widget.TextView family). I'm still finding a way to change the ListView fonts.

3 Likes

Have you found a way to change listview fonts?
I am still waiting for your listview fonts aix. :wink:

ListView is a bit different. It is a special library (I think), so it might be impossible to do that. But Iโ€™ll check on that.

1 Like

You should see the source code :

It might be possible.

1 Like

Do you mean you can make aix with this java code? I don't know about java. :sob:
How do I use this java code? I'm still looking for a way to handle listview font using code.

Can you give me any tips?

Post the design waht kind you listview / gridview you want to make , i will create

:smiling_face_with_tear:Thanks.
I'm just using the basic listview provided by AppInventor.
image

okey

1 Like