Change font family, size, color, shape in "say" & "think" blocks?

I am interested in the JavaScript sources of the looks >say and looks>think blocks.
How can I change the font family, size, font color and cloud shape in these blocks?
:sob: That's what my students are asked first of all!

I got you, I'm making a snap mod let me pull it up real quick

Process.prototype.doSayFor = function (data, secs) {
    if (!this.context.startTime) { // if the time var returns 0
        this.context.startTime = Date.now(); // setting the time var (used later) to the current time in milliseconds
        this.blockReceiver().bubble(data); // makes the bubble with the text to say
    }
    if ((Date.now() - this.context.startTime) >= (secs * 1000)) { // if the current time in milliseconds minus the time var is greater than or equal to the milliseconds inputed times 1000 (which turns them into seconds), stop talking and return null
        this.blockReceiver().stopTalking();
        return null; // (stops the script)
    }
    this.pushContext('doYield'); // repeats this script
    this.pushContext();
};

here is the code for the say for seconds block (with added comments). The bubble(); function is say, which will be shown below (also the bubble/say morph uses morphic.js's string morph with no custom font as far as i know)

image
this defines properties of the morph, does not define font. This means it uses morphic.js's default fontt

:hot_face: I'm a newbie. I will be very, very grateful if you show it in the form of a custom block!

its not possible to change the font using a custom block, sorry. Maybe with js, but i don't know how you would

And then how is it done in Pen>write(string)size(Num)? The help says that monospace (Courier) font is installed there.

Two things; I'm pretty sure font is defined somewhere I can't find, because even adding a custom font property it still uses the same font.

Also, I wouldn't be surprised if in the doWrite script font is defined somewhere. I will go look at the code now :)

update: cant find it

Well, how do I turn the rest into a custom block? :pleading_face:

Turn what?

Well, all the other bubble settings

oh, ill try to make a js script to do so tonight

Wow, awesome! Thank you very much! :smiling_face_with_three_hearts: :partying_face:

The font used in the write block is the browser selected monospace font. Yes, you can go into your browser settings to change the monospace font, and it'll change what font the write block uses.

Now of course that also requires javascript to change the font, but I'm pretty sure someone has already made a custom block to customize the write block (such as bold and changing the font).

here is a project by @joecooldoo:
https://snap.berkeley.edu/snap/snap.html#present:Username=joecooldoo&ProjectName=JS%20Free%20Customizable%20Write%20Block

My best guess to this is either
A: use the “cst_load(url)” primitive to load each letter using api requests from a website that stores each font as individual letters

B: import the costumes yourself, or get them in a list using “pixels of”

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.