Skip to content

Commit 49504b2

Browse files
committed
turn into monorepo
1 parent 533b762 commit 49504b2

File tree

254 files changed

+92243
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

254 files changed

+92243
-3
lines changed

cvdl-editor

-1
This file was deleted.

cvdl-editor/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
cvdl-editor-venv/
3+
fe2/.env
9.38 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

cvdl-editor/be/assets/Exo/OFL.txt

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Copyright 2017 The Exo Project Authors (https://github.com/NDISCOVER/Exo-1.0)
2+
3+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
4+
This license is copied below, and is also available with a FAQ at:
5+
http://scripts.sil.org/OFL
6+
7+
8+
-----------------------------------------------------------
9+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10+
-----------------------------------------------------------
11+
12+
PREAMBLE
13+
The goals of the Open Font License (OFL) are to stimulate worldwide
14+
development of collaborative font projects, to support the font creation
15+
efforts of academic and linguistic communities, and to provide a free and
16+
open framework in which fonts may be shared and improved in partnership
17+
with others.
18+
19+
The OFL allows the licensed fonts to be used, studied, modified and
20+
redistributed freely as long as they are not sold by themselves. The
21+
fonts, including any derivative works, can be bundled, embedded,
22+
redistributed and/or sold with any software provided that any reserved
23+
names are not used by derivative works. The fonts and derivatives,
24+
however, cannot be released under any other type of license. The
25+
requirement for fonts to remain under this license does not apply
26+
to any document created using the fonts or their derivatives.
27+
28+
DEFINITIONS
29+
"Font Software" refers to the set of files released by the Copyright
30+
Holder(s) under this license and clearly marked as such. This may
31+
include source files, build scripts and documentation.
32+
33+
"Reserved Font Name" refers to any names specified as such after the
34+
copyright statement(s).
35+
36+
"Original Version" refers to the collection of Font Software components as
37+
distributed by the Copyright Holder(s).
38+
39+
"Modified Version" refers to any derivative made by adding to, deleting,
40+
or substituting -- in part or in whole -- any of the components of the
41+
Original Version, by changing formats or by porting the Font Software to a
42+
new environment.
43+
44+
"Author" refers to any designer, engineer, programmer, technical
45+
writer or other person who contributed to the Font Software.
46+
47+
PERMISSION & CONDITIONS
48+
Permission is hereby granted, free of charge, to any person obtaining
49+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
50+
redistribute, and sell modified and unmodified copies of the Font
51+
Software, subject to the following conditions:
52+
53+
1) Neither the Font Software nor any of its individual components,
54+
in Original or Modified Versions, may be sold by itself.
55+
56+
2) Original or Modified Versions of the Font Software may be bundled,
57+
redistributed and/or sold with any software, provided that each copy
58+
contains the above copyright notice and this license. These can be
59+
included either as stand-alone text files, human-readable headers or
60+
in the appropriate machine-readable metadata fields within text or
61+
binary files as long as those fields can be easily viewed by the user.
62+
63+
3) No Modified Version of the Font Software may use the Reserved Font
64+
Name(s) unless explicit written permission is granted by the corresponding
65+
Copyright Holder. This restriction only applies to the primary font name as
66+
presented to the users.
67+
68+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69+
Software shall not be used to promote, endorse or advertise any
70+
Modified Version, except to acknowledge the contribution(s) of the
71+
Copyright Holder(s) and the Author(s) or with their explicit written
72+
permission.
73+
74+
5) The Font Software, modified or unmodified, in part or in whole,
75+
must be distributed entirely under this license, and must not be
76+
distributed under any other license. The requirement for fonts to
77+
remain under this license does not apply to any document created
78+
using the Font Software.
79+
80+
TERMINATION
81+
This license becomes null and void if any of the above conditions are
82+
not met.
83+
84+
DISCLAIMER
85+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93+
OTHER DEALINGS IN THE FONT SOFTWARE.

cvdl-editor/be/assets/Exo/README.txt

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
Exo Variable Font
2+
=================
3+
4+
This download contains Exo as both variable fonts and static fonts.
5+
6+
Exo is a variable font with this axis:
7+
wght
8+
9+
This means all the styles are contained in these files:
10+
Exo-VariableFont_wght.ttf
11+
Exo-Italic-VariableFont_wght.ttf
12+
13+
If your app fully supports variable fonts, you can now pick intermediate styles
14+
that aren’t available as static fonts. Not all apps support variable fonts, and
15+
in those cases you can use the static font files for Exo:
16+
static/Exo-Thin.ttf
17+
static/Exo-ExtraLight.ttf
18+
static/Exo-Light.ttf
19+
static/Exo-Regular.ttf
20+
static/Exo-Medium.ttf
21+
static/Exo-SemiBold.ttf
22+
static/Exo-Bold.ttf
23+
static/Exo-ExtraBold.ttf
24+
static/Exo-Black.ttf
25+
static/Exo-ThinItalic.ttf
26+
static/Exo-ExtraLightItalic.ttf
27+
static/Exo-LightItalic.ttf
28+
static/Exo-Italic.ttf
29+
static/Exo-MediumItalic.ttf
30+
static/Exo-SemiBoldItalic.ttf
31+
static/Exo-BoldItalic.ttf
32+
static/Exo-ExtraBoldItalic.ttf
33+
static/Exo-BlackItalic.ttf
34+
35+
Get started
36+
-----------
37+
38+
1. Install the font files you want to use
39+
40+
2. Use your app's font picker to view the font family and all the
41+
available styles
42+
43+
Learn more about variable fonts
44+
-------------------------------
45+
46+
https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts
47+
https://variablefonts.typenetwork.com
48+
https://medium.com/variable-fonts
49+
50+
In desktop apps
51+
52+
https://theblog.adobe.com/can-variable-fonts-illustrator-cc
53+
https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts
54+
55+
Online
56+
57+
https://developers.google.com/fonts/docs/getting_started
58+
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide
59+
https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts
60+
61+
Installing fonts
62+
63+
MacOS: https://support.apple.com/en-us/HT201749
64+
Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux
65+
Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows
66+
67+
Android Apps
68+
69+
https://developers.google.com/fonts/docs/android
70+
https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts
71+
72+
License
73+
-------
74+
Please read the full license text (OFL.txt) to understand the permissions,
75+
restrictions and requirements for usage, redistribution, and modification.
76+
77+
You can use them in your products & projects – print or digital,
78+
commercial or otherwise.
79+
80+
This isn't legal advice, please consider consulting a lawyer and see the full
81+
license for all details.
88.6 KB
Binary file not shown.
Binary file not shown.
88.7 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
91.2 KB
Binary file not shown.
88.9 KB
Binary file not shown.
Binary file not shown.
88.9 KB
Binary file not shown.
Binary file not shown.
88.9 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
88.8 KB
Binary file not shown.
Binary file not shown.

cvdl-editor/be/main.py

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
from typing import Union
2+
3+
from fastapi import FastAPI
4+
from fastapi.middleware.cors import CORSMiddleware
5+
from fastapi import Response, status
6+
from pymongo import MongoClient
7+
import json
8+
import requests
9+
10+
import pydantic
11+
from bson import ObjectId
12+
pydantic.json.ENCODERS_BY_TYPE[ObjectId]=str
13+
14+
mongo_conn_str = "mongodb://localhost:27017/"
15+
app = FastAPI()
16+
17+
origins = ["*"]
18+
19+
app.add_middleware(
20+
CORSMiddleware,
21+
allow_origins=origins,
22+
allow_credentials=True,
23+
allow_methods=["*"],
24+
allow_headers=["*"],
25+
)
26+
27+
CONN_STRING = "mongodb://localhost:27017/"
28+
29+
client = MongoClient(CONN_STRING)
30+
db = client.get_database('cvdl')
31+
resumes = db.get_collection('resumes')
32+
resume_layouts = db.get_collection('resume_layouts')
33+
section_layouts = db.get_collection('section_layouts')
34+
data_schemas = db.get_collection('data_schemas')
35+
36+
import os
37+
@app.post("/save_local_data")
38+
def load_local_data():
39+
for resume in os.listdir('/Users/akeles/Programming/projects/cvdl/cvdl-ts/projdir/resumes'):
40+
name = resume.removesuffix('.json')
41+
data = json.load(open(f'/Users/akeles/Programming/projects/cvdl/cvdl-ts/projdir/resumes/{resume}'))
42+
resumes.insert_one({'name': name, 'data': data})
43+
44+
resume_layouts_json = json.load(open('/Users/akeles/Programming/projects/cvdl/cvdl-ts/projdir/resume-layouts.json'))
45+
for resume_layout in resume_layouts_json:
46+
resume_layouts.insert_one(resume_layout)
47+
48+
section_layouts_json = json.load(open('/Users/akeles/Programming/projects/cvdl/cvdl-ts/projdir/layout-schemas.json'))
49+
for section_layout in section_layouts_json:
50+
section_layouts.insert_one(section_layout)
51+
52+
data_schemas_json = json.load(open('/Users/akeles/Programming/projects/cvdl/cvdl-ts/projdir/data-schemas.json'))
53+
for data_schema in data_schemas_json:
54+
data_schemas.insert_one(data_schema)
55+
56+
57+
58+
@app.get("/resumes")
59+
def list_resumes():
60+
return [(lambda resume: resume['name'])(resume) for resume in resumes.find({})]
61+
62+
@app.get("/resume/{resume_name}")
63+
def list_resumes(resume_name: str):
64+
print(resume_name)
65+
return resumes.find_one({'name': resume_name})
66+
67+
@app.get("/data_schemas")
68+
def list_data_schemas():
69+
return [(lambda data_schema: data_schema['schema_name'])(data_schema) for data_schema in data_schemas.find({})]
70+
71+
@app.get("/data_schema/{data_schema_name}")
72+
def list_data_schema(data_schema_name: str):
73+
return data_schemas.find_one({'schema_name': data_schema_name})
74+
75+
@app.get("/resume_layouts")
76+
def list_resume_layouts():
77+
return [(lambda resume_layout: resume_layout['schema_name'])(resume_layout) for resume_layout in resume_layouts.find({})]
78+
79+
@app.get("/resume_layout/{resume_layout_name}")
80+
def list_resume_layout(resume_layout_name: str):
81+
return resume_layouts.find_one({'schema_name': resume_layout_name})
82+
83+
@app.get("/layout_schemas")
84+
def list_section_layouts():
85+
return [(lambda section_layout: section_layout['schema_name'])(section_layout) for section_layout in section_layouts.find({})]
86+
87+
@app.get("/layout_schema/{section_layout_name}")
88+
def list_section_layout(section_layout_name: str):
89+
return section_layouts.find_one({'schema_name': section_layout_name})
90+
91+
@app.post("/font")
92+
def add_font(font: dict):
93+
name : str = font['name']
94+
style : str = font['style']
95+
weight : str = font['weight']
96+
97+
source: str = font['source']
98+
99+
print(name, style, weight, source)
100+
101+
def full_name(font):
102+
return font['name'] + "-" + font['weight'] + ("Italic" if font['style'] == "Italic" else "")
103+
match source:
104+
case 'Local':
105+
with open(f"assets/{name}/static/{full_name(font)}.ttf", "rb") as f:
106+
print(f"assets/{name}/static/{full_name(font)}.ttf")
107+
return Response(content=f.read(), media_type="application/x-font-ttf")
108+
case 'Remote':
109+
response = requests.get(f"https://gwfh.mranftl.com/api/fonts/{name.lower()}?subsets=latin")
110+
if response.ok:
111+
data = response.json()
112+
for variant in data['variants']:
113+
if variant['fontStyle'] == style.lower() and variant['fontWeight'] == weight.lower():
114+
response = requests.get(variant['ttf'])
115+
if response.ok:
116+
return Response(content=response.content, media_type="application/binary")
117+
return None
118+
119+
case _:
120+
return None
121+
122+

0 commit comments

Comments
 (0)