Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
515c9134
Commit
515c9134
authored
Apr 01, 2026
by
曹玉玺
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理字体
parent
f1802948
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
Dockerfile
+5
-2
scratch-web/app/base/api/impl/imghandle.js
+1
-2
No files found.
Dockerfile
View file @
515c9134
...
...
@@ -6,10 +6,13 @@ MAINTAINER jy "jiangyong@gongsibao.com"
ADD
scratch-web /apps/scratch-web/
WORKDIR
/apps/scratch-web/
#
刷新字体缓存,让 ImageMagick 识别项目中的思源宋体
#
安装思源宋体到系统字体目录并刷新缓存
RUN
yum install
-y
fontconfig
\
&&
mkdir
-p
/usr/share/fonts/zhichan
\
&&
cp /apps/scratch-web/app/base/api/impl/fonts/SourceHanSerif-Regular.ttc /usr/share/fonts/zhichan/
\
&&
chmod 644 /usr/share/fonts/zhichan/SourceHanSerif-Regular.ttc
\
&&
fc-cache
-fv
\
&&
yum clean all
\
&&
yum clean all
RUN
cnpm install
-S
CMD
["node","/apps/scratch-web/main.js"]
scratch-web/app/base/api/impl/imghandle.js
View file @
515c9134
...
...
@@ -389,8 +389,7 @@ async png2jpg (srcPng, dstJpg) {
//.font(__dirname+"/fonts/heiti.otf")
var
p
=
new
Promise
(
function
(
resv
,
reject
)
{
imageMagick
(
bs
,
bs
,
"#fff"
)
// .font(__dirname + "/fonts/songti.TTC")
.
font
(
__dirname
+
"/fonts/SourceHanSerif-Regular.ttc"
)
.
font
(
"/usr/share/fonts/zhichan/SourceHanSerif-Regular.ttc"
)
.
fontSize
(
fs
)
.
drawText
(
0
,
0
,
word
,
"center"
)
.
write
(
destfile
,
function
(
err
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment