MCPcopy Create free account
hub / github.com/FreeFem/FreeFem-sources / plotstring

Function plotstring

src/Graphics/Pcrgraph.cpp:272–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270
271
272void plotstring(const char *s)
273{
274 static HFONT hOldFont;
275
276 if (s == 0) return;
277 hOldFont = (HFONT)::SelectObject(hdc,hFont);
278 //::GetTextMetrics(hdc, &tm);
279 ::TextOut(hdc, currx, curry-fontH, s, strlen(s));
280 ::DeleteObject(hOldFont);
281
282 if(psfile) {
283 fprintf(psfile,"%d %d M\n", currx,height-curry);
284 fprintf(psfile,"(%s) S\n",s);
285 }
286 // add by fujiwara
287 if( pdffile ){
288 pdffile_content << "BT /F1 " << 9 << " Tf" << std::endl; // 9*pdf_s : text font size
289 pdffile_content << "1 0 0 1 " << currx*pdf_s << ' ' << (height-curry)*pdf_s << " Tm" << std::endl;
290 pdffile_content << "(" << string << ") Tj ET" << std::endl;
291 }
292 if( svgfile ){
293 fprintf(svgfile,"<text x=\"%.2f\" y=\"%.2f\">%s</text>\n",currx*svg_s,curry*svg_s,string);
294 }
295}
296
297void rmoveto(float x, float y)
298{

Callers 1

ShowHelpFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected