Returns options for text
(&self)
| 225 | |
| 226 | /// Returns options for text |
| 227 | fn options(&self) -> String { |
| 228 | let mut opt = String::new(); |
| 229 | if self.color != "" { |
| 230 | write!(&mut opt, ",color='{}'", self.color).unwrap(); |
| 231 | } |
| 232 | if self.align_horizontal != "" { |
| 233 | write!(&mut opt, ",ha='{}'", self.align_horizontal).unwrap(); |
| 234 | } |
| 235 | if self.align_vertical != "" { |
| 236 | write!(&mut opt, ",va='{}'", self.align_vertical).unwrap(); |
| 237 | } |
| 238 | if self.fontsize > 0.0 { |
| 239 | write!(&mut opt, ",fontsize={}", self.fontsize).unwrap(); |
| 240 | } |
| 241 | if let Some(rotation) = self.rotation { |
| 242 | write!(&mut opt, ",rotation={}", rotation).unwrap(); |
| 243 | } |
| 244 | if self.extra != "" { |
| 245 | write!(&mut opt, ",{}", self.extra).unwrap(); |
| 246 | } |
| 247 | opt |
| 248 | } |
| 249 | |
| 250 | /// Returns options for bounding box |
| 251 | fn options_bbox(&self) -> String { |
no outgoing calls