config

package
v3.1.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ShellgeiEmojiFontPath = "/usr/share/fonts/truetype/ancient-scripts/Symbola_hint.ttf"

Variables

This section is empty.

Functions

func NewMockWriter

func NewMockWriter(w, c bool) io.WriteCloser

func PrintEnvs

func PrintEnvs()

Types

type Config

type Config struct {
	Foreground               string // 文字色
	Background               string // 背景色
	Outpath                  string // 画像の出力ファイルパス
	AddTimeStamp             bool   // ファイル名末尾にタイムスタンプ付与
	SaveNumberedFile         bool   // 保存しようとしたファイルがすでに存在する場合に連番を付与する
	FontFile                 string // フォントファイルのパス
	FontIndex                int    // フォントコレクションのインデックス
	EmojiFontFile            string // 絵文字用のフォントファイルのパス
	EmojiFontIndex           int    // 絵文字用のフォントコレクションのインデックス
	UseEmojiFont             bool   // 絵文字TTFを使う
	FontSize                 int    // フォントサイズ
	UseAnimation             bool   // アニメーションGIFを生成する
	Delay                    int    // アニメーションのディレイ時間
	LineCount                int    // 入力データのうち何行を1フレーム画像に使うか
	UseSlideAnimation        bool   // スライドアニメーションする
	SlideWidth               int    // スライドする幅
	SlideForever             bool   // スライドを無限にスライドするように描画する
	ToSlackIcon              bool   // Slackのアイコンサイズにする
	PrintEnvironments        bool
	UseShellgeiImagedir      bool
	UseShellgeiEmojiFontfile bool
	ResizeWidth              int // 画像の横幅
	ResizeHeight             int // 画像の縦幅

	ForegroundColor color.RGBA // 文字色
	BackgroundColor color.RGBA // 背景色
	Texts           []string
	FileExtension   string
	Writer          io.WriteCloser
	FontFace        font.Face
	EmojiFontFace   font.Face
	EmojiDir        string
}

func (*Config) Adjust

func (a *Config) Adjust(args []string, ev EnvVars) error

adjust はパラメータを調整する。 副作用を持つ。

func (*Config) SetFontFileAndFontIndex

func (a *Config) SetFontFileAndFontIndex(runtimeOS string)

type EnvVars

type EnvVars struct {
	EmojiDir      string
	OutputDir     string
	FontFile      string
	EmojiFontFile string
}

func NewEnvVars

func NewEnvVars() EnvVars

type MockWriter

type MockWriter struct {
	// contains filtered or unexported fields
}

func (*MockWriter) Close

func (m *MockWriter) Close() error

func (*MockWriter) Write

func (m *MockWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL