Skip to content

Commit

Permalink
fix(ios): support fontWeight in html text
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Mar 16, 2021
1 parent 2d61db1 commit 114b439
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@angular/router": "~10.1.0",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@nativescript-community/text": "^1.4.8",
"@nativescript-community/text": "^1.4.9",
"@nativescript/angular": "10.1.0",
"@nativescript/core": "7.2.1",
"@nativescript/types-android": "7.2.0",
Expand Down
2 changes: 1 addition & 1 deletion plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
"license": "Apache-2.0",
"readmeFilename": "README.md",
"dependencies": {
"@nativescript-community/text": "^1.4.8"
"@nativescript-community/text": "^1.4.9"
}
}
2 changes: 2 additions & 0 deletions src/label.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,13 @@ export class Label extends LabelBase {
} else {
const font = this.nativeViewProtected.font;
const fontSize = this.fontSize || font.pointSize;
const fontWeight = this.style.fontWeight;
const familyName = this.style.fontFamily || (this.style.fontInternal && this.style.fontInternal.fontFamily) || font.familyName;
const result = createNativeAttributedString({
text: this.html,
fontSize,
familyName,
fontWeight,
color: this.color,
letterSpacing: this.letterSpacing,
lineHeight: this.lineHeight,
Expand Down

0 comments on commit 114b439

Please sign in to comment.