Documentation ¶
Overview ¶
package ogpgen は OGP 画像を生成するパッケージです。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OgpImage ¶
type OgpImage struct { Font *truetype.Font BackgroundImage image.Image FontSize float64 FontColor color.NRGBA TopMargin int SideMargin int LineSpace int }
OgpImage は OGP 画像生成に必要なフィールド等を定義した構造体です。
func NewOgpImage ¶
NewOgpImage は OgpImage のコンストラクタです。
type Option ¶
type Option struct { FontPath string FontSize float64 FontColor string BackgroundImagePath string TopMargin int SideMargin int LineSpace int }
Option は NewOgpImage の引数を定義したコンストラクタです。 FontPath は OGP 画像に描画する文字列の TrueType フォントのパスを指定します。 FontSize は OGP 画像に描画する文字列のフォントサイズを指定します。 BackgroudImagePath は OGP 画像のベースになる jpeg 画像のパスを指定します。 TopMargin は 文字列描画時の上部のマージンを微調整したい場合に指定します。 SideMargin は 文字列描画時の左右のマージンを調整したい場合に指定します。 LineSpace は 文字列描画時の行間を調整したい場合に指定します。
Click to show internal directories.
Click to hide internal directories.