Generate logo on build
authorstrongtz <strongtz@yeah.net>
星期天, 17 Jan 2021 03:49:18 +0000 (03:49 +0000)
committerBigfootACA <bigfoot@classfun.cn>
星期五, 2 Jul 2021 08:29:19 +0000 (16:29 +0800)
.gitignore
assets/Logo.bmp [new file with mode: 0644]
assets/NotoSerif-Italic.ttf [new file with mode: 0644]
assets/generate-logo.py [new file with mode: 0644]
sdm845Pkg/AcpiTables/credits/DSDTTouch.aml [new file with mode: 0644]
sdm845Pkg/Drivers/LogoDxe/Logo.bmp

index 7a46a2cbf2946308a5b41f98b6799d8a0f596395..6ca6ee13edecef5282374ffb0639f07e8593cd12 100644 (file)
@@ -6,3 +6,4 @@ uefi-*.img.gz-dtb
 workspace
 *.dll
 ramdisk
+sdm845Pkg/Drivers/LogoDxe/Logo.bmp
\ No newline at end of file
diff --git a/assets/Logo.bmp b/assets/Logo.bmp
new file mode 100644 (file)
index 0000000..a9083e6
Binary files /dev/null and b/assets/Logo.bmp differ
diff --git a/assets/NotoSerif-Italic.ttf b/assets/NotoSerif-Italic.ttf
new file mode 100644 (file)
index 0000000..968b46b
Binary files /dev/null and b/assets/NotoSerif-Italic.ttf differ
diff --git a/assets/generate-logo.py b/assets/generate-logo.py
new file mode 100644 (file)
index 0000000..d2ec026
--- /dev/null
@@ -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()
diff --git a/sdm845Pkg/AcpiTables/credits/DSDTTouch.aml b/sdm845Pkg/AcpiTables/credits/DSDTTouch.aml
new file mode 100644 (file)
index 0000000..7153455
Binary files /dev/null and b/sdm845Pkg/AcpiTables/credits/DSDTTouch.aml differ
index a9083e6506f3e620c95d54b139ccd3eda727b2da..540dc1f89f3d3d352713b7f6327293a0995de73f 100644 (file)
Binary files a/sdm845Pkg/Drivers/LogoDxe/Logo.bmp and b/sdm845Pkg/Drivers/LogoDxe/Logo.bmp differ