MCPcopy Create free account
hub / github.com/Robotips/uConfig / writeLabel

Method writeLabel

src/kicad/parser/kicadlibparser.cpp:322–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320}
321
322void KicadLibParser::writeLabel(DrawText *draw)
323{
324 _stream << " \"" << draw->text() << "\" ";
325
326 _stream << draw->pos().x() << " "
327 << -draw->pos().y() << " "
328 << draw->textSize() << " ";
329
330 if (draw->direction() == DrawText::DirectionHorizontal)
331 _stream << "H ";
332 else
333 _stream << "V ";
334
335 if (draw->isVisible())
336 _stream << "V ";
337 else
338 _stream << "I ";
339
340 switch (draw->textHJustify())
341 {
342 case DrawText::TextHCenter:
343 _stream << "C ";
344 break;
345 case DrawText::TextHLeft:
346 _stream << "L ";
347 break;
348 case DrawText::TextHRight:
349 _stream << "R ";
350 break;
351 }
352
353 switch (draw->textVJustify())
354 {
355 case DrawText::TextVCenter:
356 _stream << "C";
357 break;
358 case DrawText::TextVBottom:
359 _stream << "B";
360 break;
361 case DrawText::TextVTop:
362 _stream << "T";
363 break;
364 }
365
366 if (draw->textStyle().testFlag(DrawText::TextItalic))
367 _stream << "I";
368 else
369 _stream << "N";
370
371 if (draw->textStyle().testFlag(DrawText::TextBold))
372 _stream << "B";
373 else
374 _stream << "N";
375}
376
377Component *KicadLibParser::readComponent()
378{

Callers

nothing calls this directly

Calls 8

textMethod · 0.80
textSizeMethod · 0.80
isVisibleMethod · 0.80
textHJustifyMethod · 0.80
textVJustifyMethod · 0.80
textStyleMethod · 0.80
posMethod · 0.45
directionMethod · 0.45

Tested by

no test coverage detected