Generate logo on build
This commit is contained in:
parent
5636e9a759
commit
25cf14bcb1
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,3 +6,4 @@ uefi-*.img.gz-dtb
|
||||
workspace
|
||||
*.dll
|
||||
ramdisk
|
||||
sdm845Pkg/Drivers/LogoDxe/Logo.bmp
|
BIN
assets/Logo.bmp
Normal file
BIN
assets/Logo.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 230 KiB |
BIN
assets/NotoSerif-Italic.ttf
Normal file
BIN
assets/NotoSerif-Italic.ttf
Normal file
Binary file not shown.
46
assets/generate-logo.py
Normal file
46
assets/generate-logo.py
Normal file
@ -0,0 +1,46 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import time
|
||||
ohmydate = str(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
||||
|
||||
import sys
|
||||
pwd = sys.path[0]
|
||||
|
||||
import PIL
|
||||
from PIL import ImageFont
|
||||
from PIL import Image
|
||||
from PIL import ImageDraw
|
||||
from git import Repo
|
||||
|
||||
|
||||
imageFile = pwd + "/Logo.bmp"
|
||||
file_save_dir = pwd + "/../sdm845Pkg/Drivers/LogoDxe/"
|
||||
outputName = "Logo"
|
||||
print(ohmydate)
|
||||
|
||||
repoPath = pwd + "/.."
|
||||
repo = Repo(repoPath)
|
||||
gitHead = str(repo.head.commit)
|
||||
print(gitHead)
|
||||
strs = "head:" + gitHead + "\n Build:" + ohmydate
|
||||
|
||||
|
||||
x = 1
|
||||
y = 1
|
||||
word_size = 11
|
||||
word_css = pwd + "/NotoSerif-Italic.ttf"
|
||||
|
||||
#Set font
|
||||
font = ImageFont.truetype(word_css,word_size)
|
||||
|
||||
|
||||
im1=Image.open(imageFile)
|
||||
draw = ImageDraw.Draw(im1)
|
||||
print(font.getsize(strs))
|
||||
draw.text((x, y),strs,(255,255,0),font=font)
|
||||
|
||||
|
||||
new_filename = file_save_dir +outputName.replace(",","-").replace("\n","-")+".bmp"
|
||||
im1.save(new_filename)
|
||||
del draw
|
||||
im1.close()
|
BIN
sdm845Pkg/AcpiTables/credits/DSDTTouch.aml
Normal file
BIN
sdm845Pkg/AcpiTables/credits/DSDTTouch.aml
Normal file
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 230 KiB After Width: | Height: | Size: 230 KiB |
Loading…
Reference in New Issue
Block a user