Skip to content

Commit e751415

Browse files
SF-3625 Set custom project font for draft format component (#3547)
1 parent 61862b8 commit e751415

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ <h1>{{ t("formatting_options") }}</h1>
8585
[isRightToLeft]="isRightToLeft"
8686
[class.initializing]="isInitializing"
8787
[class.loading]="isLoadingData"
88+
[style.--project-font]="projectFont"
8889
class="viewer"
8990
></app-text>
9091
</div>

src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { combineLatest, first, firstValueFrom, Subject, switchMap } from 'rxjs';
2323
import { ActivatedProjectService } from 'xforge-common/activated-project.service';
2424
import { DataLoadingComponent } from 'xforge-common/data-loading-component';
2525
import { DialogService } from 'xforge-common/dialog.service';
26+
import { FontService } from 'xforge-common/font.service';
2627
import { I18nService } from 'xforge-common/i18n.service';
2728
import { NoticeService } from 'xforge-common/notice.service';
2829
import { OnlineStatusService } from 'xforge-common/online-status.service';
@@ -75,6 +76,7 @@ export class DraftUsfmFormatComponent extends DataLoadingComponent implements Af
7576
});
7677

7778
protected saving = false;
79+
protected projectFont?: string;
7880

7981
private updateDraftConfig$: Subject<DraftUsfmConfig | undefined> = new Subject<DraftUsfmConfig | undefined>();
8082
private lastSavedState?: DraftUsfmConfig;
@@ -91,6 +93,7 @@ export class DraftUsfmFormatComponent extends DataLoadingComponent implements Af
9193
private readonly dialogService: DialogService,
9294
readonly noticeService: NoticeService,
9395
readonly i18n: I18nService,
96+
readonly fontService: FontService,
9497
private readonly location: Location,
9598
private destroyRef: DestroyRef
9699
) {
@@ -159,6 +162,7 @@ export class DraftUsfmFormatComponent extends DataLoadingComponent implements Af
159162
} else if (this.chapters.length > 0) {
160163
defaultChapter = this.chapters[0];
161164
}
165+
this.projectFont = this.fontService.getFontFamilyFromProject(projectDoc);
162166
this.bookChanged(defaultBook, defaultChapter);
163167
});
164168

0 commit comments

Comments
 (0)