Skip to content

Tick label is cropped when using Chinese font. #573

@AllenDang

Description

@AllenDang

What are you trying to do?

Set the plot.DefualtFont to a Chinese font and tick in x-axis should be displayed completely.

What did you do?

Set font to /System/Library/Fonts/STHeiti Light.ttc

        fontData, err := ioutil.ReadFile(fontPath)
	if err != nil {
		panic(err)
	}

	font, err := truetype.Parse(fontData)
	if err != nil {
		panic(err)
	}

	fontName := "font"
	vg.AddFont(fontName, font)
	plot.DefaultFont = fontName
	plotter.DefaultFont = fontName

What did you expect to happen?

Tick should be displayed completely.
截屏2020-01-09上午10 30 58

What actually happened?

Tick label is cropped.
截屏2020-01-09上午10 27 29

What version of Go and Gonum/plot are you using?

go version go1.13.5 darwin/amd64
gonum/plog version: ca91d9d

Does this issue reproduce with the current master?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions