mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Css font properties
This commit is contained in:
15
apps/tests/pages/fonts-test.ts
Normal file
15
apps/tests/pages/fonts-test.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import stack = require("ui/layouts/stack-layout");
|
||||
import style = require("ui/styling/style");
|
||||
|
||||
export function buttonTap(args) {
|
||||
var stackLayout = <stack.StackLayout>args.object.parent;
|
||||
|
||||
for (var i = 0; i < stackLayout.getChildrenCount(); i++){
|
||||
var v = stackLayout.getChildAt(i);
|
||||
v.style._resetValue(style.fontFamilyProperty);
|
||||
v.style._resetValue(style.fontSizeProperty);
|
||||
v.style._resetValue(style.fontStyleProperty);
|
||||
v.style._resetValue(style.fontWeightProperty);
|
||||
v.style._resetValue(style.fontProperty);
|
||||
}
|
||||
}
|
||||
41
apps/tests/pages/fonts-test.xml
Normal file
41
apps/tests/pages/fonts-test.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<Page>
|
||||
<ScrollView>
|
||||
<StackLayout id="stack">
|
||||
<Button text="RESET" tap="buttonTap"/>
|
||||
|
||||
<Label text="Label: normal" />
|
||||
<Label text="Label: size" style="font-size: 32" />
|
||||
<Label text="Label: italic" style="font-style: italic" />
|
||||
<Label text="Label: bold" style="font-weight: bold"/>
|
||||
<Label text="Label: bold-italic" style="font-weight: bold; font-style: italic"/>
|
||||
<Label text="Label: times new" style="font-family: Times New Roman"/>
|
||||
<Label text="Label: all in one" style="font-family: Times New Roman; font-weight: bold; font-style: italic; font-size: 32" />
|
||||
|
||||
<Button text="Button: normal" />
|
||||
<Button text="Button: size" style="font-size: 32" />
|
||||
<Button text="Button: italic" style="font-style: italic" />
|
||||
<Button text="Button: bold" style="font-weight: bold"/>
|
||||
<Button text="Button: bold-italic" style="font-weight: bold; font-style: italic"/>
|
||||
<Button text="Button: times new" style="font-family: Times New Roman"/>
|
||||
<Button text="Button: all in one" style="font-family: Times New Roman; font-weight: bold; font-style: italic; font-size: 32" />
|
||||
|
||||
<TextView text="TextView: normal" />
|
||||
<TextView text="TextView: size" style="font-size: 32" />
|
||||
<TextView text="TextView: italic" style="font-style: italic" />
|
||||
<TextView text="TextView: bold" style="font-weight: bold"/>
|
||||
<TextView text="TextView: bold-italic" style="font-weight: bold; font-style: italic"/>
|
||||
<TextView text="TextView: times new" style="font-family: Times New Roman"/>
|
||||
<TextView text="TextView: all in one" style="font-family: Times New Roman; font-weight: bold; font-style: italic; font-size: 32" />
|
||||
|
||||
<TextField text="TextField: normal" />
|
||||
<TextField text="TextField: size" style="font-size: 32" />
|
||||
<TextField text="TextField: italic" style="font-style: italic" />
|
||||
<TextField text="TextField: bold" style="font-weight: bold"/>
|
||||
<TextField text="TextField: bold-italic" style="font-weight: bold; font-style: italic"/>
|
||||
<TextField text="TextField: times new" style="font-family: Times New Roman"/>
|
||||
<TextField text="TextField: all in one" style="font-family: Times New Roman; font-weight: bold; font-style: italic; font-size: 32" />
|
||||
|
||||
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</Page>
|
||||
Reference in New Issue
Block a user