The style of Layout::Label can't change

save_path = 'C:\Users\admin\Desktop\无标题2.layout'
doc = Layout::Document.new
leader_type = Layout::Label::LEADER_LINE_TYPE_TWO_SEGMENT
anchor_type = Layout::FormattedText::ANCHOR_TYPE_CENTER_RIGHT
start_point = Geom::Point2d.new(20.mm, 20.mm)
end_point = Geom::Point2d.new(10.mm, 10.mm)
lable = Layout::Label.new('test', leader_type, start_point, end_point, anchor_type)

style = lable.style
style.font_family = '宋体'
style.font_size = 20

sub_style = style.get_sub_style Layout::Style::DIMENSION_TEXT
sub_style.font_family = '宋体'
sub_style.font_size = 20
style.set_sub_style Layout::Style::DIMENSION_TEXT, sub_style

lable.style = style

doc.add_entity lable, doc.layers.first, doc.pages.first
doc.save save_path
UI.openURL save_path

I should use the Layout::Style::LABEL_XXX.

save_path = 'C:\Users\admin\Desktop\无标题2.layout'
doc = Layout::Document.new
leader_type = Layout::Label::LEADER_LINE_TYPE_TWO_SEGMENT
anchor_type = Layout::FormattedText::ANCHOR_TYPE_CENTER_RIGHT
start_point = Geom::Point2d.new(20.mm, 20.mm)
end_point = Geom::Point2d.new(10.mm, 10.mm)
lable = Layout::Label.new('test', leader_type, start_point, end_point, anchor_type)

style = lable.style
style.font_family = '宋体'
style.font_size = 20

sub_style = style.get_sub_style Layout::Style::LABEL_TEXT
sub_style.font_family = '宋体'
sub_style.font_size = 20
style.set_sub_style Layout::Style::LABEL_TEXT, sub_style

lable.style = style

doc.add_entity lable, doc.layers.first, doc.pages.first
doc.save save_path
UI.openURL save_path