Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cyrillic font #2856

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stylesheets/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ body {
height: 100%;
width: 100%;
margin: 0;
font-family: $session-font-default;
font-family: var(--font-default);
letter-spacing: 0.3px;
}

Expand Down
11 changes: 2 additions & 9 deletions stylesheets/_session.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ textarea {
background: var(--text-selection-color);
}

.shadowed {
opacity: $session-shadow-opacity;
}
.overlayed {
opacity: $session-overlay-opacity;
pointer-events: none;
}
.overlay {
display: flex !important;
z-index: 1;
Expand Down Expand Up @@ -197,7 +190,7 @@ label {
box-sizing: border-box;
max-height: 70vh;
max-width: calc(min(70vw, 800px));
font-family: $session-font-default;
font-family: var(--font-default);
background-color: var(--modal-background-content-color);
color: var(--modal-text-color);
border: 1px solid var(--border-color);
Expand Down Expand Up @@ -256,7 +249,7 @@ label {

&__body {
padding: 0px var(--margins-lg) var(--margins-lg) var(--margins-lg);
font-family: $session-font-default;
font-family: var(--font-default);
line-height: $session-font-md;
font-size: $session-font-md;
overflow-y: auto;
Expand Down
55 changes: 22 additions & 33 deletions stylesheets/_session_constants.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,101 +2,96 @@
// /////////////////// Fonts ////////////////////
// //////////////////////////////////////////////

$session-font-default: 'Roboto';
$session-font-accent: 'Loor';
$session-font-mono: 'SpaceMono';

@font-face {
font-family: $session-font-mono;
font-family: SpaceMono;
src: url('../fonts/SpaceMono-Regular.ttf') format('truetype');
}

// Roboto is an open replacement for $session-font-default
@font-face {
font-family: $session-font-default;
font-family: Roboto;
src: url('../fonts/Roboto-Thin.ttf') format('truetype');
font-weight: 100;
}

@font-face {
font-family: $session-font-default;
font-family: Roboto;
src: url('../fonts/Roboto-ThinItalic.ttf') format('truetype');
font-style: italic;
font-weight: 100;
}

@font-face {
font-family: $session-font-default;
font-family: Roboto;
src: url('../fonts/Roboto-Light.ttf') format('truetype');
font-weight: 300;
}

@font-face {
font-family: $session-font-default;
font-family: Roboto;
src: url('../fonts/Roboto-LightItalic.ttf') format('truetype');
font-style: italic;
font-weight: 300;
}

@font-face {
font-family: $session-font-default;
font-family: Roboto;
src: url('../fonts/Roboto-Regular.ttf') format('truetype');
font-weight: 400;
}

@font-face {
font-family: $session-font-default;
font-family: Roboto;
src: url('../fonts/Roboto-Italic.ttf') format('truetype');
font-style: italic;
font-weight: 400;
}

@font-face {
font-family: $session-font-default;
font-family: Roboto;
src: url('../fonts/Roboto-Medium.ttf') format('truetype');
font-weight: 500;
}

@font-face {
font-family: $session-font-default;
font-family: Roboto;
src: url('../fonts/Roboto-MediumItalic.ttf') format('truetype');
font-style: italic;
font-weight: 500;
}

@font-face {
font-family: $session-font-default;
font-family: Roboto;
src: url('../fonts/Roboto-Bold.ttf') format('truetype');
font-weight: 700;
}

@font-face {
font-family: $session-font-default;
font-family: Roboto;
src: url('../fonts/Roboto-BoldItalic.ttf') format('truetype');
font-weight: 700;
font-style: italic;
}

@font-face {
font-family: $session-font-default;
font-family: Roboto;
src: url('../fonts/Roboto-Black.ttf') format('truetype');
font-weight: 900;
}

@font-face {
font-family: $session-font-default;
font-family: Roboto;
src: url('../fonts/Roboto-BlackItalic.ttf') format('truetype');
font-weight: 900;
font-style: italic;
}

// Accented font
@font-face {
font-family: $session-font-accent;
font-family: Loor; // Loor does not support some Cyrillic ghyphs so where we use it, we add a fallback to Roboto
src: url('../fonts/Loor.ttf') format('truetype');
line-height: 1.4rem;
}

// //////////////////////////////////////////////
// ////////////////// Colors ////////////////////
// //////////////////////////////////////////////

// Opacity and Shadow
$session-shadow-opacity: 0.15;
$session-overlay-opacity: 0.3;

// //////////////////////////////////////////////
// /////////////////// Text /////////////////////
// //////////////////////////////////////////////
Expand All @@ -106,13 +101,7 @@ $session-font-xs: 11px;
$session-font-sm: 13px;
$session-font-md: 15px;

$session-font-h2: 24px;

// Mixins
@mixin fontAccentBold {
font-weight: bold;
font-family: $session-font-accent;
}

@mixin text-highlight($color) {
background-color: $color;
Expand Down
8 changes: 4 additions & 4 deletions stylesheets/_session_signin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
&-content {
&-accent {
&-text {
font-family: $session-font-accent;
font-family: var(--font-accent), var(--font-default);
text-align: center;
.title {
font-size: 90px;
Expand Down Expand Up @@ -91,7 +91,7 @@
&-input-with-label-container {
height: 46.5px;
width: 280px;
font-family: $session-font-default;
font-family: var(--font-default);
color: var(--text-primary-color);

padding: 2px 0 2px 0;
Expand Down Expand Up @@ -126,7 +126,7 @@
background: transparent;
color: var(--input-text-color);

font-family: $session-font-default;
font-family: var(--font-default);
font-size: 12px;
line-height: 14px;
position: absolute;
Expand Down Expand Up @@ -214,7 +214,7 @@
overflow-wrap: break-word;
padding: 0px 5px 20px 5px;
display: inline-block;
font-family: $session-font-mono;
font-family: var(--font-mono), var(--font-default);
user-select: all;
overflow: hidden;
resize: none;
Expand Down
3 changes: 2 additions & 1 deletion stylesheets/_session_theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@
}

@mixin session-h-title {
@include fontAccentBold();
font-weight: bold;
font-family: var(--font-accent), var(--font-default);
}

h1 {
Expand Down
2 changes: 1 addition & 1 deletion ts/components/leftpane/LeftPaneSettingSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { SessionSettingCategory } from '../settings/SessionSettings';
import { LeftPaneSectionHeader } from './LeftPaneSectionHeader';

const StyledSettingsSectionTitle = styled.strong`
font-family: var(--font-font-accent);
font-family: var(--font-accent), var(--font-default);
font-size: var(--font-size-md);
`;

Expand Down
2 changes: 1 addition & 1 deletion ts/components/leftpane/overlay/OverlayClosedGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { ToastUtils } from '../../../session/utils';
import { createClosedGroup } from '../../../session/conversations/createClosedGroup';

const StyledMemberListNoContacts = styled.div`
font-family: var(--font-font-mono);
font-family: var(--font-mono), var(--font-default);
background: var(--background-secondary-color);
text-align: center;
padding: 20px;
Expand Down
8 changes: 4 additions & 4 deletions ts/themes/globals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { COLORS } from './constants/colors';
export type ThemeGlobals = {
/* Fonts */
'--font-default': string;
'--font-font-accent': string;
'--font-font-mono': string;
'--font-accent': string;
'--font-mono': string;
'--font-size-xs': string;
'--font-size-sm': string;
'--font-size-md': string;
Expand Down Expand Up @@ -87,8 +87,8 @@ export type ThemeGlobals = {
// These are only set once in the global style (at root).
export const THEME_GLOBALS: ThemeGlobals = {
'--font-default': 'Roboto',
'--font-font-accent': 'Loor',
'--font-font-mono': 'SpaceMono',
'--font-accent': 'Loor',
'--font-mono': 'SpaceMono',
'--font-size-xs': '11px',
'--font-size-sm': '13px',
'--font-size-md': '15px',
Expand Down