Skip to content

Commit 6cae35c

Browse files
Merge pull request #3 from Merck/feature/remove-fonts
Feature/remove fonts
2 parents ccc7f68 + 4635525 commit 6cae35c

29 files changed

Lines changed: 100 additions & 19 deletions

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,84 @@ Linea should now be available in your web browser at [http://localhost:3000](htt
198198
##### Note
199199
If you receive an error with Google Oauth after the server has been started and you attempt to log in, regenerate client id and client secret and edit the `google_oauth.yml` file as per the oauth section of the [deployment instructions](./linea_docs/linea_deployment_instructions.md).
200200

201+
202+
## Customizing Fonts
203+
204+
Linea uses custom fonts defined in the CSS files. To add your own custom fonts, follow these steps:
205+
206+
### 1. Adding Font Files to the Public Directory
207+
208+
Create a fonts directory in the public folder and add your font files:
209+
210+
```bash
211+
# Create the fonts directory
212+
mkdir -p public/fonts
213+
214+
# Copy your font files to the directory
215+
# Example: cp /path/to/your/fonts/* public/fonts/
216+
```
217+
218+
Your font files should be in common web font formats such as:
219+
- `.woff` (Web Open Font Format)
220+
- `.woff2` (Web Open Font Format 2)
221+
- `.ttf` (TrueType Font)
222+
- `.eot` (Embedded OpenType)
223+
- `.svg` (Scalable Vector Graphics)
224+
225+
### 2. Updating the CSS File
226+
227+
Open the main CSS file at `app/assets/stylesheets/application.css.scss` and replace all instances of `"add-your-font"` with your actual font file names.
228+
229+
The file currently contains placeholder `@font-face` declarations like this:
230+
231+
```scss
232+
@font-face{
233+
font-family:'add-your-font';
234+
src: font-url('add-your-font');
235+
}
236+
```
237+
238+
Replace these with your actual font declarations. For example, if you're using a font called "CustomFont":
239+
240+
```scss
241+
@font-face{
242+
font-family:'CustomFont-Regular';
243+
src: font-url('CustomFont-Regular.woff2') format('woff2'),
244+
font-url('CustomFont-Regular.woff') format('woff'),
245+
font-url('CustomFont-Regular.ttf') format('truetype');
246+
font-weight: normal;
247+
font-style: normal;
248+
}
249+
250+
@font-face{
251+
font-family:'CustomFont-Bold';
252+
src: font-url('CustomFont-Bold.woff2') format('woff2'),
253+
font-url('CustomFont-Bold.woff') format('woff'),
254+
font-url('CustomFont-Bold.ttf') format('truetype');
255+
font-weight: bold;
256+
font-style: normal;
257+
}
258+
```
259+
260+
### 3. Updating the Font Family Variable
261+
262+
Also update the `$font-family-sans-serif` variable in the same file:
263+
264+
```scss
265+
$font-family-sans-serif: "CustomFont-Regular", Helvetica Neue, Arial, Verdana, sans-serif;
266+
```
267+
268+
### 4. Recompile Assets
269+
270+
After making changes, recompile your assets:
271+
272+
```bash
273+
rake assets:precompile
274+
```
275+
276+
Then restart your Rails server for the changes to take effect.
277+
278+
### Note on Asset Pipeline
279+
280+
If you place fonts in `public/fonts/`, they will be served directly. Alternatively, you can place them in `app/assets/fonts/` to have them processed through the Rails asset pipeline. If using the asset pipeline approach, use `font-url()` helper without the full path, as Rails will automatically find fonts in the asset directories.
281+

app/assets/stylesheets/application.css.scss

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -96,27 +96,27 @@ $modal-title-font-size: 18px;
9696

9797
//Typography
9898
$navFontSize: 16px;
99-
$font-family-sans-serif: "UniversLTStdLight";
99+
$font-family-sans-serif: "add-your-font";
100100

101101
@font-face{
102-
font-family:'UniversLTStd';
103-
src: font-url('UniversLTStd.otf');
102+
font-family:'add-your-font';
103+
src: font-url('add-your-font');
104104
}
105105
@font-face{
106-
font-family:'UniversLTStdLight';
107-
src: font-url('UniversLTStd-Light.otf');
106+
font-family:'add-your-font';
107+
src: font-url('add-your-font');
108108
}
109109
@font-face{
110-
font-family:'UniversLTStdLightCond';
111-
src: font-url('UniversLTStd-LightCn.otf');
110+
font-family:'add-your-font';
111+
src: font-url('add-your-font');
112112
}
113113
@font-face{
114-
font-family:'UniversLTStdBold';
115-
src: font-url('UniversLTStd-Bold.otf');
114+
font-family:'add-your-font';
115+
src: font-url('add-your-font');
116116
}
117117
@font-face{
118-
font-family:'UniversLTStdCondensed';
119-
src: font-url('UniversLTStd-Cn.otf');
118+
font-family:'add-your-font';
119+
src: font-url('add-your-font');
120120
}
121121
@font-face {
122122
font-family: 'Linea';
@@ -535,7 +535,7 @@ label {
535535
border-radius: 0;
536536
border: none;
537537
color: #FFF;
538-
@include fontFamily('UniversLTStdLightCond');
538+
@include fontFamily('add-your-font');
539539
}
540540
}
541541

@@ -594,7 +594,7 @@ label {
594594
}
595595
.filter-section-title {
596596
margin-top: 20px;
597-
@include fontFamily('UniversLTStdBold');
597+
@include fontFamily('add-your-font');
598598
color: $filterSectionTitleColor;
599599
}
600600
input[type=checkbox] {
@@ -605,7 +605,7 @@ label {
605605
top: 5px;
606606

607607
+ label {
608-
@include fontFamily('UniversLTStd');
608+
@include fontFamily('add-your-font');
609609
color: $filterSectionTitleColor;
610610
/*text-transform: capitalize;*/
611611
max-width: 90%;
@@ -635,7 +635,7 @@ label {
635635
.related-datasets-container {
636636
.title {
637637
padding: 20px 0 5px;
638-
@include fontFamily('UniversLTStdBold');
638+
@include fontFamily('add-your-font');
639639
font-size: 18px;
640640
color: $secondaryTextColor;
641641
&:first-of-type {
@@ -694,7 +694,7 @@ label {
694694
.pagination {
695695
display: block;
696696
text-align: center;
697-
@include fontFamily("UniversLTStdCondensed");
697+
@include fontFamily("add-your-font");
698698
font-size: 18px;
699699
.previous_page {
700700
position: absolute;
@@ -709,7 +709,7 @@ label {
709709
}
710710
}
711711
.user-name {
712-
@include fontFamily('UniversLTStd');
712+
@include fontFamily('add-your-font');
713713
font-size: 14px;
714714
margin-right: 5px;
715715
div[class*="-activity"] & {
@@ -1171,7 +1171,7 @@ footer {
11711171
background-color: $selectedColor;
11721172
}
11731173
a {
1174-
@include fontFamily("UniversLTStdLightCond");
1174+
@include fontFamily("add-your-font");
11751175
font-size: 16px;
11761176
color: #FFF;
11771177
}
@@ -2045,4 +2045,4 @@ i.external-link-icon {
20452045

20462046
.twitter-share-button {
20472047
margin-bottom: -4px;
2048-
}
2048+
}
-35.7 KB
Binary file not shown.
-30.6 KB
Binary file not shown.
-31.5 KB
Binary file not shown.
-36.3 KB
Binary file not shown.

public/Fonts/UniversLTStd-Bold.otf

-35.5 KB
Binary file not shown.
-29 KB
Binary file not shown.
-30.1 KB
Binary file not shown.
-32.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)