Re: Logging Library-GSOC

2020-05-22 Thread Priyesh kumar
Hey guys,
After going through the discussion, I think I am confused about the actual
requirements from the project.
Clearly there is some problem with the current logger, but I think the
requirements which are mentioned on the FreeType's GSoC page and the
requirements which are discussed being here
are different...
Please could you guys guide me with the actual requirements as there is
very little time left for coding to begin...
Thanks
Priyesh

On Thu, May 21, 2020 at 2:07 PM  wrote:

> > Armin, could you chime in and add your opinion?
>
> Gladly, sorry for the delay guys!
>
> >> I'm sorry but that doesn't make any sense to me.  There is absolutely
> >> no point in making part of FreeType depend on a specific external
> >> logger library at this point.  Also we don't even know which library,
> >> or which API.  This looks like a solution looking for a problem.
> >>
> >> Also we don't necessarily send logs to stderr, e.g. there are already
> >> several versions of ftdebug.c, i.e. the one under builds/windows/ uses
> >> OutputDebugStringA(), or the one under builds/amiga/ uses KVPrintf(),
> >> etc..  All Werner wants is structured outputs, which can easily be
> >> done in the current code base with minimal refactor of the FT_TRACE
> >> macro implementations.
> >
> > Mhmm, yes and no.  For example, if you want to have time stamps in the
> logging
> > output, too, you have to take care of the OS since you are entering
> > platform-specific behaviour.  It would be nice if this is completely
> hidden.
>
> Agreed;  also in addition, the two biggest things to be improved from my
> perspective:
>
>   1. Dynamic change of desired output log levels
>   2. Dynamic log redirection
>
> I've recently been working on long-running (for days/weeks straight) video
> transcoders, depending on several libraries like FFmpeg, FreeType, ...  One
> thing that is 100% needed is to change log levels on the fly (enable more
> logging as things go south) and be able to redirect logs to wherever I want
> them to go, separate for each library, maybe prefixed differently on the
> fly
> (files, memory, ...  best case, again, changeable at runtime).  I consider
> both things reasonably standard and something I'd love to see in FreeType
> as
> well :)
>
> About external dependencies:  everything you don't build yourself leaves
> more time for the things you actually want to build.  I do get the concern
> (it's a trade-off) but the question IMO is how easy it is to replace
> dependencies.  In terms of an external logging library I imagine it to be
> very easily replaceable should that become interesting at some point.
>
> A few more thoughts about recent messages (didn't chime in since, by the
> point I read it, it was already answered in a way that I agreed with):
>
>   - 100% submodule + static linking
>
>   - Let's keep using various FreeType macros within the code base and use
> the
> external library mainly for writing out + the filtering / forwarding /
> flexibility part
>
> The biggest upside of an external logging lib IMO is not to care about its
> implementation and cross platform compatibility, just use something that's
> been tried + tested and spend all the more time on the core business of
> font
> rendering.  Also provide users of FreeType a way to extract logs in an
> extremely flexible way that does not require users to dig deep into the
> implementation of the codebase in order to write a personalised log
> callback
> function that filters and converts relevant logs and requires users to do
> all sorts of nasty downcasts that really only library implementers are
> comfortable doing.
>
> Just a few thoughts, happy to discuss further :)
>
>


Re: resizable ft2demos

2020-05-22 Thread Anuj Verma
I have attached the diff of my implementation. I have handled the SC_SIZE
message
and resize the window manually in a non blocking way.


Anuj


changes.diff
Description: Binary data


Re: resizable ft2demos

2020-05-22 Thread Dmitry Timoshkov
Alexei Podtelezhnikov  wrote:

> Dmitry,
> > It probably needs adding CS_HREDRAW | CS_VREDRAW to ourClass.style.
> 
> That was not enough.

I'll try to find time and have a look at it.

-- 
Dmitry.



Re: resizable ft2demos

2020-05-22 Thread Anuj Verma
> Is that true? Handling WM_SIZING alone was not enough.

No, simply handling WM_SIZING or WM_SIZE is not enough in the current
scenario.
There is a separate system message SC_SIZE under the WM_SYSCOMMAND
(https://docs.microsoft.com/en-us/windows/win32/menurc/wm-syscommand) which
is
posted when the user tries to resize the window.

Currently the DefWindowProc handles the SC_SIZE command and it goes into a
loop
while the window is being resized. So, you need to handle this message and
resize the
window manually according to the mouse position.

I'll try to implement this and let you know.


Anuj


Re: resizable ft2demos

2020-05-22 Thread Alexei Podtelezhnikov
Dmitry,
> It probably needs adding CS_HREDRAW | CS_VREDRAW to ourClass.style.

That was not enough.

Anuj,
> The window enters a modal loop whenever you start resizing the window, the
> loop terminates when the mouse is released.

Yes and I have read that during the look WM_SIZING and WM_NCPAINT fire
up. Is that true? Handling WM_SIZING alone was not enough.

Thanks,
Alexei



Re: resizable ft2demos

2020-05-22 Thread Dmitry Timoshkov
Anuj Verma  wrote:

> The window enters a modal loop whenever you start resizing the window, the
> loop terminates when the mouse is released.
> more on this here:
> https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-entersizemove
> So I think the solution would be to handle the "WM_SYSCOMMAND" message and
> manually resize the window. You can
> also integrate this code. (
> https://sourceforge.net/p/win32loopl/code/ci/default/tree/)

That's clearly an overkill. Probably that code is nice to have for
education purposes, but it should not be needed to get window repainted
when being resized.

-- 
Dmitry.



Re: resizable ft2demos

2020-05-22 Thread Anuj Verma
The window enters a modal loop whenever you start resizing the window, the
loop terminates when the mouse is released.
more on this here:
https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-entersizemove
So I think the solution would be to handle the "WM_SYSCOMMAND" message and
manually resize the window. You can
also integrate this code. (
https://sourceforge.net/p/win32loopl/code/ci/default/tree/)

Anuj