<div dir="ltr"><div><div>Unfortunately, there is no resolution-independent back-end as the interface from LibreOffice to the OS is in discrete pixels and it has made extensive use of that ubiquitous design.<br><br>I agree for user-created objects such as arrows and such, things should be defined in terms of resolution-independent values and zoomablee. However, the character property for underlining doesn't let you choose precise widths except for normal and bold. Squiggly underlines give you no choice as it isn't important and can be decided for you independently of zoom or font size. As higher-resolution or scalable bitmaps are designed,  hidpi logic can be removed, but in the short to medium term, LibreOffice has  places that draw things, and an easy and safe fix is to double it, and possibly triple it. There is perhaps a chance you don't need 3x for mobile because the eyes are closer to the screen. The vast majority of LibreOffice works as you say and the rest can invisibly and steadily move that way over time. There are plenty of ways to improve the widget layers. Consider also that if you scaled the 16 pixel-wide toolbar buttons to 19 pixels, you wouldn't like the result. Getting it to work well with 1x and 2x is just the start.<br>
<br></div><div>Regards,<br></div><div><br></div><div>-Keith<br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Dec 13, 2013 at 4:40 PM, Tomaž Vajngerl <span dir="ltr"><<a href="mailto:quikee@gmail.com" target="_blank">quikee@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<div><div class="h5"><br>
On Fri, Dec 13, 2013 at 9:58 PM, Keith Curtis <<a href="mailto:keithcu@gmail.com">keithcu@gmail.com</a>> wrote:<br>
> Hi Kendy,<br>
><br>
> Good to hear from you. I've got a number of things in progress on my<br>
> computer beyond the underlines<br>
> (<a href="https://wiki.documentfoundation.org/Development/HiDpi" target="_blank">https://wiki.documentfoundation.org/Development/HiDpi</a>) but I wait to get an<br>
> API first as I'm just writing "if (1) //hidpi".<br>
><br>
> I personally don't think a floating point value is a good idea. At the<br>
> lowest level, pixel line widths go to 2 or 3 and in the square case go to 4<br>
> or 9. I believe anything who wants more resolution should probably be<br>
> working based on the system font size. The changes I'm making don't seem to<br>
> need more than 3 and even 2 is plenty for all laptops today and into the<br>
> distant future. Floating point arithmetic used to be a lot slower than<br>
> integer as well but I don't know if that is still true ;-)<br>
><br>
> I hope it is okay if I can write code that handles the 2x case but has no<br>
> guarantees about any other value. I can't test what I can't see and there is<br>
> a fair amount of work to get LibreOffice looking good and supporting<br>
> variable-sized bitmaps at all. So if it were up to me, I'd just make it a<br>
> boolean for a while, and focus / force that part to look great everywhere.<br>
> Then when you were ready to further generalize it, the compiler would make<br>
> you to validate all the areas. I even have been taking advantage of the<br>
> simplicity. I found some arrow drawing logic that wanted an odd-sized height<br>
> for best results. And so I just doubled it and subtracted one ;-)<br>
><br>
> My biggest concern wrt the API is that it has the right value out of the<br>
> box. For example, what do normal Macs return for the system font size versus<br>
> Retinas? What about on Windows? There is plenty of intelligence that can go<br>
> into a bit.<br>
><br>
> Putting the change in ImplDrawWaveLine is possible. My change is safer in<br>
> that it mostly only touches the spelling / grammar which is the most<br>
> noticeable issue. With ImplDrawWaveLine you have to worry about more<br>
> callers, printers, etc. and possibilities for dirt on screen. I wouldn't<br>
> necessarily recommend shifting down 2 pixels for the low-level drawing code,<br>
> so maybe you'd still have to have changes in both places. ImplDrawWaveLine<br>
> is a routine takes a pixel line width as input, so perhaps the policy<br>
> decision should be above it. It seems sort of like putting the bitmap<br>
> doubling logic into the BitBlt routine versus in the toolbar which loads the<br>
> bitmaps. I could look at the wavy underline character property logic, but I<br>
> think it is low priority and still might not change the ImplDrawWaveLine. I<br>
> haven't looked into it. I'm happy to fix any bugs in my simple code, but get<br>
> concerned about suggestions that complicate it ;-)<br>
><br>
> Working on this early next week would be great. I've got about 600 more<br>
> lines in 14 files to review that make a difference. There is a fair amount<br>
> of low-hanging fruit. I am possibly stuck on two issues, but I plug away on<br>
> it as I have free time. The hardest part is finding the actual line of code<br>
> that have the bug. With my work, they are being marked which makes future<br>
> work easier. I did see code that is possibly problematic in places like<br>
> DecoView but I'm just focusing on the visible ones. Toolbar bitmaps are the<br>
> most important. The Sidebar is the most broken. Do you think they will fix<br>
> it?<br>
><br>
> Anyway, I look forward to working through the issues soon because I have<br>
> some time now and hopefully getting this into 4.2.<br>
><br>
> -Keith<br>
<br>
</div></div>Great work. But IMHO this doesn't really solve the problem - or at<br>
least I think this approach is not correct for canvas elements like<br>
wave lines. Everything drawn on canvas should be defined in absolute<br>
units (100th mm or similar) and not pixels. If I set the width of a<br>
wave line to 2 mm I expect that when the monitor DPI = system DPI and<br>
the zoom level is 100%, that I can take the ruler and measure the wave<br>
line width to be exactly 2 mm (and 4 mm at zoom 200%, 8 mm at zoom<br>
400%, ...). This must be true for all elements on the canvas at least<br>
(for toolbars and non canvas elements IMHO the same rule should apply<br>
but this requires then a resolution independent backend).<br>
<br>
Regards, Tomaž<br>
</blockquote></div><br></div>