Skip to content

Commit b276845

Browse files
committed
Change Ubuntu font name to 'sans-serif'
This allows us to skip explicitly setting the font name for our default font
1 parent e088806 commit b276845

File tree

20 files changed

+22
-41
lines changed

20 files changed

+22
-41
lines changed

.changeset/odd-beers-wear.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@plexinc/react-native-lightning-example": patch
3+
"@plexinc/react-lightning-components": patch
4+
"@plexinc/react-native-lightning": patch
5+
"@plexinc/react-lightning-example": patch
6+
"@plexinc/react-lightning-storybook": patch
7+
---
8+
9+
Changed font name from Ubuntu to `sans-serif`

apps/react-lightning-example/src/components/AnimatedImage.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ const AnimatedImage = () => {
4141
style={{ width: 200, height: 300, borderRadius: 8 }}
4242
/>
4343

44-
<lng-text style={{ fontFamily: 'Ubuntu', y: 300 }}>
45-
Hello Darkness My Old Frnd
46-
</lng-text>
44+
<lng-text style={{ y: 300 }}>Hello Darkness My Old Frnd</lng-text>
4745
</lng-view>
4846
);
4947
};

apps/react-lightning-example/src/components/Button.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const containerStyles = {
1717
};
1818

1919
const textStyle = {
20-
fontFamily: 'Ubuntu',
2120
fontSize: 32,
2221
lineHeight: containerStyles.height,
2322
textAlign: 'center' as const,

apps/react-lightning-example/src/components/HubItem.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export const HubItem = ({ metadata, style }: Props) => {
2929

3030
<lng-text
3131
style={{
32-
fontFamily: 'Ubuntu',
3332
fontSize: 25,
3433
lineHeight: 30,
3534
maxWidth: 250,

apps/react-lightning-example/src/components/HubRow.tsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,15 @@ export const HubRow = (props: Props) => {
1515
if (isLoading) {
1616
return (
1717
<lng-view style={style}>
18-
<lng-text style={{ fontFamily: 'Ubuntu' }}>Loading...</lng-text>
18+
<lng-text>Loading...</lng-text>
1919
</lng-view>
2020
);
2121
}
2222

2323
if (!data || error) {
2424
return (
2525
<lng-view style={style}>
26-
<lng-text style={{ fontFamily: 'Ubuntu' }}>
27-
There was an error loading the hub
28-
</lng-text>
26+
<lng-text>There was an error loading the hub</lng-text>
2927
</lng-view>
3028
);
3129
}
@@ -34,7 +32,6 @@ export const HubRow = (props: Props) => {
3432
<Column {...rest} style={style} focusable>
3533
<lng-text
3634
style={{
37-
fontFamily: 'Ubuntu',
3835
fontSize: 40,
3936
lineHeight: 50,
4037
marginBottom: 20,

apps/react-lightning-example/src/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ const router = createBrowserRouter([
6161
const options: RenderOptions = {
6262
fonts: (stage) => [
6363
new SdfTrFontFace('msdf', {
64-
fontFamily: 'Ubuntu',
64+
fontFamily: 'sans-serif',
6565
descriptors: {},
6666
atlasUrl: '/fonts/Ubuntu-Regular.msdf.png',
6767
atlasDataUrl: '/fonts/Ubuntu-Regular.msdf.json',
6868
stage,
6969
}),
7070
new SdfTrFontFace('msdf', {
71-
fontFamily: 'Ubuntu',
71+
fontFamily: 'sans-serif',
7272
descriptors: {
7373
weight: 'bold',
7474
},

apps/react-lightning-example/src/pages/AnimationPage.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ export const AnimationPage = () => {
1616
return (
1717
<>
1818
<Column focusable style={{ gap: 20, zIndex: 10 }}>
19-
<lng-text
20-
style={{ fontFamily: 'Ubuntu', color: 0xffffffff, fontSize: 50 }}
21-
>
19+
<lng-text style={{ color: 0xffffffff, fontSize: 50 }}>
2220
Poster Count: {numPosters}
2321
</lng-text>
2422
<Column focusable style={{ width: 200, gap: 10 }}>

apps/react-lightning-example/src/pages/BrowsePage.tsx

+2-6
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,11 @@ export const BrowsePage = () => {
1515
}, []);
1616

1717
if (isLoading) {
18-
return <lng-text style={{ fontFamily: 'Ubuntu' }}>Loading...</lng-text>;
18+
return <lng-text>Loading...</lng-text>;
1919
}
2020

2121
if (!data || error) {
22-
return (
23-
<lng-text style={{ fontFamily: 'Ubuntu' }}>
24-
There was an error loading the data
25-
</lng-text>
26-
);
22+
return <lng-text>There was an error loading the data</lng-text>;
2723
}
2824

2925
return (

apps/react-lightning-example/src/pages/Page60.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export const Question = ({ text, w }: { text: string; w?: number }) => {
1919
>
2020
<lng-text
2121
style={{
22-
fontFamily: 'Ubuntu',
2322
fontSize: 48,
2423
maxLines: 3,
2524
textAlign: 'center' as const,

apps/react-lightning-example/src/pages/PosterPage.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export const PosterPage = () => {
2222
<Button>Beep</Button>
2323
<lng-text
2424
style={{
25-
fontFamily: 'Ubuntu',
2625
fontSize: 40,
2726
lineHeight: 50,
2827
marginLeft: 20,

apps/react-native-lightning-example/src/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ AppRegistry.runApplication('plex', {
121121
driver: 'normal',
122122
fonts: (stage) => [
123123
new SdfTrFontFace('msdf', {
124-
fontFamily: 'Ubuntu',
124+
fontFamily: 'sans-serif',
125125
descriptors: {
126126
weight: 'bold',
127127
},
@@ -130,7 +130,7 @@ AppRegistry.runApplication('plex', {
130130
stage,
131131
}),
132132
new SdfTrFontFace('msdf', {
133-
fontFamily: 'Ubuntu',
133+
fontFamily: 'sans-serif',
134134
descriptors: {},
135135
atlasUrl: '/fonts/Ubuntu-Regular.msdf.png',
136136
atlasDataUrl: '/fonts/Ubuntu-Regular.msdf.json',

apps/react-native-lightning-example/src/pages/LibraryTest.tsx

-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ const Poster = focusable<Props, LightningElement>(
4444
style={{
4545
opacity: alpha,
4646
fontSize: 30,
47-
fontFamily: 'Ubuntu',
4847
fontWeight: 'bold',
4948
textAlign: 'center',
5049
}}
@@ -55,7 +54,6 @@ const Poster = focusable<Props, LightningElement>(
5554
style={{
5655
opacity: alpha,
5756
fontSize: 20,
58-
fontFamily: 'Ubuntu',
5957
fontWeight: 'normal',
6058
textAlign: 'center',
6159
}}
@@ -143,7 +141,6 @@ export const LibraryTest = () => {
143141
style={{
144142
zIndex: 99,
145143
fontSize: 50,
146-
fontFamily: 'Ubuntu',
147144
// @ts-expect-error TODO
148145
y: 50,
149146
}}

apps/storybook/public/fonts/metrics/Ubuntu-Bold.metrics.json

-6
This file was deleted.

apps/storybook/src/react-lightning-components/text/StyledText.stories.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { StyledText } from '@plexinc/react-lightning-components';
22
import React from 'react';
33
import Button from '../../components/Button';
4-
import { DefaultStoryWidth } from '../../helpers/constants';
54

65
const LANGUAGE = {
76
EN: 'en',

packages/react-lightning-components/src/components/FPSMonitor.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ const FPSMonitor = ({ style }: Props) => {
4545
style={{
4646
color,
4747
display: 'flex',
48-
fontFamily: 'Ubuntu',
4948
fontSize: 20,
5049
mountX: 1,
5150
position: 'absolute',

packages/react-lightning-components/src/components/StyledText.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ type Part = {
1515
};
1616

1717
const BASE_STYLE = {
18-
fontFamily: 'Ubuntu',
1918
fontSize: 18,
2019
lineHeight: 24,
2120
};

packages/react-native-lightning/src/exports/FlatList.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function getItemCountDefault<T>(data: T[] | null | undefined): number {
3131
}
3232

3333
const renderAsText = ({ item }: { item: unknown }) => {
34-
return <lng-text style={{ fontFamily: 'Ubuntu' }}>{String(item)}</lng-text>;
34+
return <lng-text>{String(item)}</lng-text>;
3535
};
3636

3737
class FlatList<T> extends React.Component<FlatListProps<T>> {

packages/react-native-lightning/src/exports/Text.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export type TextProps = AddMissingProps<ViewProps, RNTextProps> & {
1515

1616
const defaultTextStyle: Partial<LightningTextElementStyle> = {
1717
// contain: 'width',
18-
fontFamily: 'Ubuntu',
1918
fontWeight: 'normal',
2019
};
2120

templates/app-template/src/components/Text.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ type Props = {
55
style?: LightningTextElementStyle;
66
};
77

8-
const defaultStyle = { fontFamily: 'Ubuntu', fontSize: 24 };
8+
const defaultStyle = { fontSize: 24 };
99

1010
export const Text = ({ children, style }: Props) => (
1111
<lng-text style={{ ...defaultStyle, ...style }}>{children}</lng-text>

templates/app-template/src/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const router = createBrowserRouter([
3030
const options: RenderOptions = {
3131
fonts: (stage) => [
3232
new SdfTrFontFace('msdf', {
33-
fontFamily: 'Ubuntu',
33+
fontFamily: 'sans-serif',
3434
descriptors: {},
3535
atlasUrl: '/fonts/Ubuntu-Regular.msdf.png',
3636
atlasDataUrl: '/fonts/Ubuntu-Regular.msdf.json',

0 commit comments

Comments
 (0)