forked from opencrvs/opencrvs-countryconfig
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Endpoint for certificate fonts & configuration (#782)
* Serve fonts & certificate configuration * Use noto-sans in certificate config
- Loading branch information
1 parent
aadd271
commit e049853
Showing
8 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
* | ||
* OpenCRVS is also distributed under the terms of the Civil Registration | ||
* & Healthcare Disclaimer located at http://opencrvs.org/license. | ||
* | ||
* Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. | ||
*/ | ||
|
||
import { COUNTRY_CONFIG_URL } from '@countryconfig/constants' | ||
|
||
type FontFamilyTypes = { | ||
normal: string | ||
bold: string | ||
italics: string | ||
bolditalics: string | ||
} | ||
|
||
type Configuration = Partial<{ | ||
fonts: Record<string, FontFamilyTypes> | ||
}> | ||
|
||
export function certificateConfigurationHandler(): Configuration { | ||
return { | ||
fonts: { | ||
['Noto Sans']: { | ||
normal: `${COUNTRY_CONFIG_URL}/fonts/NotoSans-Regular.ttf`, | ||
bold: `${COUNTRY_CONFIG_URL}/fonts/NotoSans-SemiBold.ttf`, | ||
italics: `${COUNTRY_CONFIG_URL}/fonts/NotoSans-Regular.ttf`, | ||
bolditalics: `${COUNTRY_CONFIG_URL}/fonts/NotoSans-Regular.ttf` | ||
} | ||
} | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
* | ||
* OpenCRVS is also distributed under the terms of the Civil Registration | ||
* & Healthcare Disclaimer located at http://opencrvs.org/license. | ||
* | ||
* Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. | ||
*/ | ||
|
||
import { Request, ResponseToolkit } from '@hapi/hapi' | ||
import { join } from 'path' | ||
|
||
export function fontsHandler(request: Request, h: ResponseToolkit) { | ||
return h.file(join(__dirname, request.params.filename)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters