#3320: d.text does not show anything with screen position in geographic
coordinates or pixels
----------------------------+-------------------------
Reporter: wenzeslaus | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.2.1
Component: Display | Version: 7.2.0
Keywords: d.text d.graph | CPU: Unspecified
Platform: Unspecified |
----------------------------+-------------------------
G7:d.text works only with the default settings. I get nothing when using
the `-g` (map/geo coordinates) or `-p` (screen pixels). Same in trunk and
7.2 (likely also 7.0).
Relevant flags and option:
{{{
-p Screen position in pixels ([0,0] is top left)
-g Screen position in geographic coordinates
at Screen position at which text will begin to be drawn (percentage,
[0,0] is lower left)
}}}
#3320: d.text does not show anything with screen position in geographic
coordinates or pixels
--------------------------+----------------------------
Reporter: wenzeslaus | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.2.1
Component: Display | Version: 7.2.0
Resolution: | Keywords: d.text d.graph
CPU: Unspecified | Platform: Unspecified
--------------------------+----------------------------
Comment (by hcho):
I fixed d.text, but d.mon still has the same problem. I think this issue
is related to d.mon rendering. If I use the cairo or png driver directly,
it works fine.
{{{
d.mon start=cairo output=cairo.png --o
d.text percent size=5 at=70,70
d.text pixel size=5 at=50,50 -p
d.text mapcoors size=5 at=-402022,924563 -g # any map coordinates inside
the monitor
d.mon stop=cairo
}}}
#3320: d.text does not show anything with screen position in geographic
coordinates or pixels
--------------------------+----------------------------
Reporter: wenzeslaus | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.2.1
Component: Display | Version: 7.2.0
Resolution: | Keywords: d.text d.graph
CPU: Unspecified | Platform: Unspecified
--------------------------+----------------------------
Comment (by hcho):
I found the default at=50,50 in DtextController in decorations.py. The
default for d.text is actually the upper-left corner. This option is empty
in GUI, so at=50,50 is totally unexpected. I think it shouldn't have any
hard-coded default. Because of this forced default, we cannot run:
{{{
d.text input=text.txt
}}}
to display text from the upper-left corner.
#3320: d.text does not show anything with screen position in geographic
coordinates or pixels
--------------------------+----------------------------
Reporter: wenzeslaus | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.2.1
Component: Display | Version: 7.2.0
Resolution: | Keywords: d.text d.graph
CPU: Unspecified | Platform: Unspecified
--------------------------+----------------------------
Comment (by annakrat):
Replying to [comment:4 hcho]:
> I found the default at=50,50 in DtextController in decorations.py. The
default for d.text is actually the upper-left corner. This option is empty
in GUI, so at=50,50 is totally unexpected. I think it shouldn't have any
hard-coded default. Because of this forced default, we cannot run:
> {{{
> d.text input=text.txt
> }}}
> to display text from the upper-left corner.
Positioning in GUI is handled separately, because it needs to be more
interactive. The 50,50 is there to make sure the entire text is rendered
and not cut off anywhere. Flags -p and -g won't work here easily, the GUI
would have to recompute the coordinates. But that should be a separate
ticket I think.
#3320: d.text does not show anything with screen position in geographic
coordinates or pixels
--------------------------+----------------------------
Reporter: wenzeslaus | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.2.1
Component: Display | Version: 7.2.0
Resolution: | Keywords: d.text d.graph
CPU: Unspecified | Platform: Unspecified
--------------------------+----------------------------
Comment (by hcho):
Not only in GUI, it happens in d.mon wx0 as well (command line monitor).
Flags -p and -g don't work both in g.gui GUI and d.mon WX monitors. They
only work for direct cairo and png. Would it be difficult to fix -p & -g
in GUI & d.mon WX monitors?
Also, I don't understand why forcing the default position at the center
(50%,50%) would make sure the entire text is rendered without being cut
off. We're losing a lot more space by placing text at the center instead
of starting it from the upper-left corner. We also lost the capability of
starting from the default upper-left corner because now we have to guess
where that would be and type it in the at option. That's not ideal at all.