# Changing component fonts?

**URL:** <https://forum.kirupa.com/t/changing-component-fonts/55663>\
**Category:** flash\
**Created:** [June 26, 2004, 11:51am UTC](https://forum.kirupa.com/t/changing-component-fonts/55663 "2004-06-26T11:51:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mindfriction](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mindfriction/32/172_2.png) [@mindfriction](https://forum.kirupa.com/u/mindfriction)\
**Post date:** [June 26, 2004, 11:51am UTC](https://forum.kirupa.com/t/changing-component-fonts/55663/1 "2004-06-26T11:51:57Z")

</div>

Hi guys and girls,

Any diffinitive way to change component fonts on a global scale?

The **globalStyleFormat.textFont** property doesn’t embed fonts and doesnt seem to work with Font Symbols :(. Ive seen a thread on Flashkit for adding properties to an FStyleFormat object (below). But how to apply this globally im not sure

```auto

myStyle = new FStyleFormat();
myStyle.textSize = 16;
//myStyle.embedFonts = true;
myStyle.textFont = "Arial";
myStyle.textBold = true; // So that the text is bold.
myStyle.addListener(myComponent);
myStyle.applyChanges();

//then to embed fonts on the component
myComponent.setStyleProperty ("textFont", "Font 1");
myComponent.setStyleProperty ("embedFonts", true);

```

This is what ive been working on, and I cant see why its not working

```auto

// ActionScript Document
FStyleFormat.prototype.applyIn = function(scope, sub, font) {
	// scope - path in which the components are to apply the FstyleFormat to
	// sub - also include submovieclips ?
	trace("applyIn");
	for (all in scope) {
		trace("for");
		if (scope[all] instanceof FCheckBox || scope[all] instanceof FPushButton || scope[all] instanceof FComboBox || scope[all] instanceof FListBox || scope[all] instanceof FScrollBar || scope[all] instanceof FScrollPane || scope[all] instanceof FRadioButton) {
			trace(scope[all]);
			this.addListener(scope[all]);
			scope[all].setStyleProperty("textFont", font);
			scope[all].setStyleProperty("embedFonts", true);
		}
	}
	this.applyChanges();
};
globalComponentStyleFormat = new FStyleFormat();
globalComponentStyleFormat.background = 0xFFFFFF;
//white
//outer line color
globalComponentStyleFormat.darkshadow = 0x333333;
globalComponentStyleFormat.highlight3D = 0x333333;
//inner line color
globalComponentStyleFormat.shadow = 0x909090;
globalComponentStyleFormat.highlight = 0xffffff;
//face of buttons and scrollbar
globalComponentStyleFormat.arrow = 0x000000;
globalComponentStyleFormat.face = 0xDFE49A;
//bg blue
//scrollbar colors
globalComponentStyleFormat.scrollTrack = 0x666666;
//text scopeatting
globalComponentStyleFormat.textFont = "mySwiss721";
globalComponentStyleFormat.textSize = 12;
globalComponentStyleFormat.textColor = 0x000000;
//colors for selected items in list
globalComponentStyleFormat.selection = 0xBEBEBE;
globalComponentStyleFormat.selectionDisabled = 0xCCCCCC;
globalComponentStyleFormat.selectionUnfocused = 0x909090;
globalComponentStyleFormat.textDisabled = 0x666666;
globalComponentStyleFormat.textSelected = 0x666666;
//checkbox scopeatting
globalComponentStyleFormat.check = 0x228B22;

globalComponentStyleFormat.applyIn(this, 0, "mySwiss721");

stop();

```
