eclipsesource / eclipsesource/tabris-js

Custom fonts referenceable by family instead of alias

Open
#1,824 0 comments 0 reactions 0 assignees View on GitHub
bug ios
Dominant language
JavaScript
Stars
1.4k
Forks
171
PR merge metrics
No merged PRs in 30d

Description

### Problem description
According to the [documentation](https://docs.tabris.com/latest/api/app.html#registerfontalias-file), the font alias should be used to reference a custom font on all platforms except on Windows. Currently, however, it can only be referenced by its original font family instead. Other than deviating from the documented API, this can be an issue when a font has variants using the same family. In this case, those variants currently cannot be differentiated by the framework without modifying the font variant files themselves to use different families.

### Expected behavior

Custom fonts should be referenceable by their given aliases on iOS.

### Environment

- Tabris.js version: nightly
- Platform: iOS
- OS: 12.1.1

### Code snippet

Font used: https://fonts.google.com/specimen/Raleway; `Raleway-Bold.ttf` from the download.

```jsx
import { app, WidgetCollection, TextView, contentView } from 'tabris';

app.registerFont('my-raleway-font-alias', 'fonts/Raleway-Bold.ttf');

contentView.append(




);

```

|iOS|Android (expected)|
|---|---|
|![IMG_0027](https://user-images.githubusercontent.com/2341769/54196866-bd319c00-44c2-11e9-9575-dcf5939aab0a.jpg)|![20190312_122906](https://user-images.githubusercontent.com/2341769/54196874-c1f65000-44c2-11e9-8aef-d1d445be77d1.jpg)|

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.