mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-08-30 12:12:40 +08:00
feat(渲染注释): 渲染注释,可配置不渲染
This commit is contained in:
@@ -67,6 +67,7 @@ func NewRenderer(reader *Reader, opts ...RendererOption) *Renderer {
|
||||
r := &Renderer{
|
||||
Reader: reader,
|
||||
DPI: 300.0,
|
||||
RenderAnnotations: true,
|
||||
DrawParams: reader.drawParamCache,
|
||||
CompositeGraphicUnits: reader.compositeGraphicUnitCache,
|
||||
FontMap: make(map[string]*canvas.FontFamily),
|
||||
@@ -87,6 +88,15 @@ func WithDPI(dpi float64) RendererOption {
|
||||
}
|
||||
}
|
||||
|
||||
// WithAnnotations 设置是否渲染注释外观
|
||||
// 入参: enable 是否渲染
|
||||
// 返回: RendererOption 渲染选项
|
||||
func WithAnnotations(enable bool) RendererOption {
|
||||
return func(r *Renderer) {
|
||||
r.RenderAnnotations = enable
|
||||
}
|
||||
}
|
||||
|
||||
// WithFontDirs 设置外部字体查找目录
|
||||
// 入参: dirs 字体目录列表
|
||||
// 返回: RendererOption 渲染选项
|
||||
|
||||
Reference in New Issue
Block a user