Re: [Lazarus] PDF generator: please test

2016-04-10 Thread Dmitry Boyarintsev
On Sun, Apr 10, 2016 at 4:23 AM, Michael Van Canneyt  wrote:
>
>
> No, why ? One is about encoding of the supplied text.
>
> The other about whether the current font has the necessary glyphs to render
> the text.


I see the issue now. It's in my perception of PDF format.
I always assumed it represents text as a sequence of glyphs, rather than
sequence of characters. But it seems like both options are possible.

thanks,
Dmitry
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Pretty neat stuff Lazarus

2016-04-10 Thread Alan Corey
I ignored the help issues for now and opened my trusty Delphi 3 on my
laptop for reference.  Cranked out my first program in a couple hours.
It was 20 megs until I turned optimization on and debugging off, then
it went down to a little over 4.  The C command line version is about
8 K, but oh well.

Installing and running as root seems to present a strange problem in
that when I rebuild the IDE it doesn't write the new version to
/root/.lazarus/lazarus, it stays in /usr/local/bin.  I'll figure it
out.  So that's why adding packages and rebuilding seemed to not work,
because I had lazarus-ide in my rxvt menu but the new versions were
ending up as /usr/local/bin/lazarus and I wasn't using them.
Rebuilding the real thing while I was running it crashed big time.

New questions:  Can I use my Deplhi 3 help files?  These are old-style
.hlp files, not .chm.  How can I change my help browser from Opera?
Firefox thinks it's default but Opera keeps getting called somehow.
The problem with it is that since it's not open source I'm actually
running a Linux binary under Linux emulation, which is slow.

I saw the illegal character error only once, doing a clean and build
got around it.

Now to try compiling this into an apk file...

-- 
Credit is the root of all evil.  - AB1JX
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] [solved] Re: Filtering shown files in TShellListView

2016-04-10 Thread Marc Santhoff
On So, 2016-04-10 at 22:39 +0200, Bart wrote:
> On 4/10/16, Marc Santhoff  wrote:
> 
> > I thought so too, but only because I didn't look for the "Mask" property
> > of TCustomShellListView. :)
> 
> I didn't see it in OI, was too lazy to look it up in the source.
> Looks like a property that should be published?

I think so. I only found it when I wanted to start implmenting it myself
while looking at the list population code. ;)

-- 
Marc Santhoff 


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] 1 keypress gives multiple letters ONLY in program written in Lazarus in raspbian jessie Pi 2

2016-04-10 Thread

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] 1 keypress gives multiple letters ONLY in program written in Lazarus in raspbian jessie Pi 2

2016-04-10 Thread Giuliano Colla

Il 10/04/2016 21:16, Michael Thompson ha scritto:
Giuliano: Do you know if any of the steps listed here would have 
helped?  If not, can you let me know how you disabled the Input 
Manager, and I'll update the wiki accordinly.


I have only hearsay knowledge, from this list complaints, and from some 
search on Internet I made because of that.
I'm not using Ubuntu or any other Debian/Ubuntu derived distro, and I do 
not have a direct experience.
I'm using the Red Hat distros line (RHEL, Fedora and CentOs) and I did 
never stumble into a similar problem.
Therefore take what I say with appropriate caution (and most of all do 
not use it in tribunal .)


However the problem appears to arise from the Keyboard Input Methods 
being enabled by default, even when no actual Input Method is assigned. 
From what I gathered, this problem popped up as with Ubuntu 11, and 
should be related to Gnome Desktop.
Previous versions were immune, but I can't tell if it was because ibus 
service wasn't used, or because Keyboard Input Methods were not enabled.


However the full picture is the following:

Input Methods are those methods which allow to accommodate languages 
with ideographic symbols which cannot possibly fit in a normal sized 
keyboard, such as Chinese.


Those user need also to enter Latin alphabet characters for system 
commands, therefore a keyboard shortcut is required to toggle on and off 
the Input Method.


The standard shortcut to toggle Input Method is ctrl-space, which 
happens also to be the standard code completion shortcut of Lazarus. 
This alone can be a cause of troubles.
Moreover, if the Input Methods are enabled, but no actual Input method 
is defined, toggling may lead to weird results, such as characters being 
entered twice, characters being lost etc.


The steps to overcome the problem are:

1) If Input Methods are required (e.g. a Chinese user), one of the two 
shortcuts must be changed.


2) If no Input Methods are required, they should be disabled. No general 
rule can be given on how to do that, because each Desktop environment 
does it its way. Gnome provides in System Settings an "Input Method" 
entry. KDE provides an Icon in the systray, but only if a specific Input 
Method package has been installed, otherwise the Input Methods are disabled.


3) If no Input Methods are required and the user is unable to disable 
the Input Methods, one can simply stop the ibus service, whose only 
purpose appears to be that of supporting the Input Methds. Again, how to 
do that is strongly system dependent.


I can't say if the steps indicated in the Wiki page are useful in 
general. From what I read GTK_IM_MODULE=gtk-im-context-simple
should be a better choice than gtk-im-context-xim which enables the old 
XIM (X Input Method) framework.
But it would require some testing in Ubuntu or Ubuntu siblings, and with 
different locale.


That's all I can tell.

Giuliano


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Transparent TPanel reloaded

2016-04-10 Thread Martin Grajcar
I've found quite a few posting regarding a transparent TPanel and somehow
nothing fits. All I need is to place controls on a panel and let it look
like there were directly on its parent. I don't want to create a component
for this.

The panel is colored clDefault and placed on a form colored clDefault, too.
Using ParentColor := TRUE, on Ubuntu 12 with GTK2 the form is $F2F5F7 and
the panel is much darker.

I guess, I finally found a solution, but I don't really understand it:

BevelInner := bvNone;
BevelOuter := bvNone;
Caption := '';
BorderStyle := bsNone;
ParentColor := False;
IF Assigned (Parent) THEN Color := Parent.GetRGBColorResolvingParent;

The final line is funny. I thought, just GetRGBColorResolvingParent should
work, but it doesn't. Any idea?

Regards, Martin.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] [solved] Re: Filtering shown files in TShellListView

2016-04-10 Thread Bart
On 4/10/16, Marc Santhoff  wrote:

> I thought so too, but only because I didn't look for the "Mask" property
> of TCustomShellListView. :)

I didn't see it in OI, was too lazy to look it up in the source.
Looks like a property that should be published?

Bart

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] 1 keypress gives multiple letters ONLY in program written in Lazarus in raspbian jessie Pi 2

2016-04-10 Thread Michael Thompson
I know this issue is resolved, but I've just stumbled across this:

http://wiki.lazarus.freepascal.org/Lazarus_Faq#Typing_under_Ubuntu_in_edit_fields_generate_duplicate_letters

We'll need to change Ubuntu now to Linux in general, but before I do that:
Giuliano: Do you know if any of the steps listed here would have helped?
If not, can you let me know how you disabled the Input Manager, and I'll
update the wiki accordinly.

Thanks

Mike

On 10 April 2016 at 23:02, Dennis  wrote:

>
>
> Giuliano Colla wrote:
>
>> Il 09/04/2016 18:49, JuuS ha scritto:
>>
>>> Personally I had quite a fight with ibus and I finally removed it from
>>> my system with no ill effects. It is mostly used AFAIK with asian
>>> "alphabets".
>>>
>>
>> There must be some problem with ibus/input methods in the Debian line,
>> because it would appear that more or less all recent Debian based distro's
>> (Ubuntu, Raspbian, ect.) show some weird keyboard behaviour, which wasn't
>> present in the previous versions.
>>
>> Red Hat line (Red Hat, Fedora, CentOs etc.) appears to be immune from
>> this problem. I didn't find any complaint of this type on Internet, and
>> when I have been forced to enable keyboard input methods to support
>> Chinese, nothing strange happened (except when if you forget to switch back
>> to English ;-) ...)
>>
>> Maybe someone with a good knowledge of both worlds could find where the
>> problem is?
>>
>> Giuliano
>>
>> I turned off Raspbian's Input Method and the problem is gone now.
> thanks for everyone's tips.
>
> Dennis
>
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TScrollbar users

2016-04-10 Thread Zeljko



On 04/10/2016 08:01 PM, Mattias Gaertner wrote:

On Sun, 10 Apr 2016 19:24:31 +0200
Zeljko  wrote:


Hi all,
Today I've fixed longstanding bug with TScrollbar and max allowed
position of thumb. http://bugs.freepascal.org/view.php?id=20127
Now , gtk2 (gtk lib >= 2.14), qt and win32 have unified behaviour.
Pls. test against lazarus trunk >= r52156 and see if there's some
regression or problem since I want to merge those fixes into 1.6.2.

P.S: Carbon users feedback is badly needed (haven't touch anything on
osx yet ... too far away from my mac machine till next sunday)


Seems to work.
I don't see a difference. There are no up/down arrows on my Mac.


Ah, then it'll work fine. Have you tested with example provided there ?

Thanks for testing :)

zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TScrollbar users

2016-04-10 Thread Mattias Gaertner
On Sun, 10 Apr 2016 19:24:31 +0200
Zeljko  wrote:

> Hi all,
> Today I've fixed longstanding bug with TScrollbar and max allowed 
> position of thumb. http://bugs.freepascal.org/view.php?id=20127
> Now , gtk2 (gtk lib >= 2.14), qt and win32 have unified behaviour.
> Pls. test against lazarus trunk >= r52156 and see if there's some 
> regression or problem since I want to merge those fixes into 1.6.2.
> 
> P.S: Carbon users feedback is badly needed (haven't touch anything on 
> osx yet ... too far away from my mac machine till next sunday)

Seems to work.
I don't see a difference. There are no up/down arrows on my Mac.

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] TScrollbar users

2016-04-10 Thread Zeljko

Hi all,
Today I've fixed longstanding bug with TScrollbar and max allowed 
position of thumb. http://bugs.freepascal.org/view.php?id=20127

Now , gtk2 (gtk lib >= 2.14), qt and win32 have unified behaviour.
Pls. test against lazarus trunk >= r52156 and see if there's some 
regression or problem since I want to merge those fixes into 1.6.2.


P.S: Carbon users feedback is badly needed (haven't touch anything on 
osx yet ... too far away from my mac machine till next sunday)


Thanks.

zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Trying to work around "Illegal character in format string"

2016-04-10 Thread Graeme Geldenhuys
On 2016-04-10 13:08, Giuliano Colla wrote:
> but AFAIR it didn't handle too well chm help

Then lucky I only use INF help with DocView. It doesn't matter what
version of Lazarus I use, and doesn't extra packages to be installed in
Lazarus (thus a IDE recompile). DocView all the way! :)

Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] 1 keypress gives multiple letters ONLY in program written in Lazarus in raspbian jessie Pi 2

2016-04-10 Thread Dennis



Giuliano Colla wrote:

Il 09/04/2016 18:49, JuuS ha scritto:

Personally I had quite a fight with ibus and I finally removed it from
my system with no ill effects. It is mostly used AFAIK with asian
"alphabets".


There must be some problem with ibus/input methods in the Debian line, 
because it would appear that more or less all recent Debian based 
distro's (Ubuntu, Raspbian, ect.) show some weird keyboard behaviour, 
which wasn't present in the previous versions.


Red Hat line (Red Hat, Fedora, CentOs etc.) appears to be immune from 
this problem. I didn't find any complaint of this type on Internet, 
and when I have been forced to enable keyboard input methods to 
support Chinese, nothing strange happened (except when if you forget 
to switch back to English ;-) ...)


Maybe someone with a good knowledge of both worlds could find where 
the problem is?


Giuliano


I turned off Raspbian's Input Method and the problem is gone now.
thanks for everyone's tips.

Dennis

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Trying to work around "Illegal character in format string"

2016-04-10 Thread Juha Manninen
On Sun, Apr 10, 2016 at 4:26 PM, Alan Corey  wrote:
> Should I have maybe removed ~/.lazarus?

The local config is backwards compatible and updated automatically but
soemtimes after experimenting a lot it can become corrupt. Then you
can delete it.

> I still can't get the chmhelp package to install, even after
> upgrading, rebuilding the IDE, restarting.  It's mentioned in
> ~/.lazarus/idemake.cfg and ~/.lazarus/staticpackages.inc but it still
> shows with a green +.

You installed to a write protected dir /usr/local/share/lazarus, right?
When you rebuild the IDE as normal user, the new binary goes to your
home dir under ~/.lazarus.
Instead of "lazarus" you should run "startlazarus". It checks where
the latest binary is and starts it for you.
I am sure it was documented somewhere ...

Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Trying to work around "Illegal character in format string"

2016-04-10 Thread Alan Corey
OK, I downloaded 1.6 overnight and installed it, haven't seen the
illegal character error since.

Nice to add: If the OS is one of the BSDs, Tools -> Options ->
Environment -> 'Make' executable should default to gmake on install.
Or just look for gmake in the path and default to it if found.
OpenBSD's make gives an error on -w as an argument which rebuilding
the IDE by the buttons at least uses.

There's no 'make uninstall' so I renamed my old lazarus directory and
installed beside it.  Should I have maybe removed ~/.lazarus?

I still can't get the chmhelp package to install, even after
upgrading, rebuilding the IDE, restarting.  It's mentioned in
~/.lazarus/idemake.cfg and ~/.lazarus/staticpackages.inc but it still
shows with a green +.

Should I be able to get to the point where I can do ctrl-F1 on a
keyword in the editor to bring up help on it?  F1 in a field in Object
Inspector is working to bring up htmlhelp.

Whaddya mean read the documentation?  It doesn't even have a manpage. :)

-- 
Credit is the root of all evil.  - AB1JX

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Trying to work around "Illegal character in format string"

2016-04-10 Thread Giuliano Colla

Il 10/04/2016 02:00, Graeme Geldenhuys ha scritto:

:-)   I still have 0.9.30 here in one of my Windows VM's. It still works
great!  If it ain't broken, don't fix it.;-)
Me too, in one of my USB disks. I happily keep it alive to support 
released software, but AFAIR it didn't handle too well chm help, and 
version 1.0 wasn't much better.


An "Illegal character in format string" error message makes it look a 
bit broken, IMHO ;-)


Giuliano

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator: please test

2016-04-10 Thread Michael Van Canneyt



On Sun, 10 Apr 2016, Graeme Geldenhuys wrote:


On 2016-04-10 08:15, Michael Van Canneyt wrote:

Wow, let me interfere here before we go in a wrong direction:

The public API should not depend on the selected font.


I know. The current implementation gravitated towards the situation we
have now, but that is definitely not how it is going to end up. Like I
mentioned in one of my earlier replies, we will end up with overloaded
WriteText() calls only, and internally the fpPDF code will sort out what
font code to generate. Up to now, one of my high priority was figuring
out font embedding and handling of ASCII and Unicode text - this task
seems complete (except for the Unicode range above BMP which still needs
some minor attention).

These should all be addressed in the next round of updates.


OK, seems we are of the same mind, I just wanted to make sure of that :-)

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator: please test

2016-04-10 Thread Graeme Geldenhuys
On 2016-04-10 08:15, Michael Van Canneyt wrote:
> Wow, let me interfere here before we go in a wrong direction:
> 
> The public API should not depend on the selected font.

I know. The current implementation gravitated towards the situation we
have now, but that is definitely not how it is going to end up. Like I
mentioned in one of my earlier replies, we will end up with overloaded
WriteText() calls only, and internally the fpPDF code will sort out what
font code to generate. Up to now, one of my high priority was figuring
out font embedding and handling of ASCII and Unicode text - this task
seems complete (except for the Unicode range above BMP which still needs
some minor attention).

These should all be addressed in the next round of updates.

Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator: please test

2016-04-10 Thread Michael Van Canneyt



On Sun, 10 Apr 2016, Dmitry Boyarintsev wrote:


On Sun, Apr 10, 2016 at 3:15 AM, Michael Van Canneyt 

Re: [Lazarus] PDF generator: please test

2016-04-10 Thread Dmitry Boyarintsev
On Sun, Apr 10, 2016 at 3:15 AM, Michael Van Canneyt  wrote:

It feels like, these two paragraphs:

>
> The user of the API should not have to care what font is used.
> the API should do whatever is necessary to emit correct PDF for the
> current font.
>
> If internally there are different calls needed for different fonts, then
> that is OK, but they should not be exposed to the user, at the best they
> should be made protected.
> (if need be, we can expose them later)
>

contradict to:


> If the currently used font does not contain the necessary glyphs to
> represent
> the text, we will not check it, that is the responsability of the user.


The APIs should either do the font-substitution  (with whatever level  of
control from the user side). (something what graphic APIs are doing for
text rendering)
or should not do them at all (leaving full font-substitution to the user)

Then there should be some cross-platform APIs provided (not necessary part
of PDF package) that would perform font substitution by the (unicode) text
and the desired font (font-size).

Eventually, someone would provide  WriteUTF8TextSmart() function, that
would split the text into parts (by fonts used) and would populate the PDF
accordingly, if PDF library doesn't the font-substitution itself.

For example, rendering a text with mix of latin letters and hieroglyphs,
using Times New Roman font. Typically for hieroglyphs one of system default
CJK fonts are used.

thanks,
Dmitry
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator: please test

2016-04-10 Thread Michael Van Canneyt



On Sun, 10 Apr 2016, Graeme Geldenhuys wrote:


On 2016-04-09 09:09, Ondrej Pokorny wrote:

   P.WriteText(25, 0, 'Sample Text'); // DOESN'T WORK !!!


Indeed. As I mentioned, the Write*Text() names are a bit inaccurate and
will be improved. At the moment WriteText() is meant for the Standard
PDF Fonts, and WriteUTF8Text() for any TTF fonts used.


Wow, let me interfere here before we go in a wrong direction:

The public API should not depend on the selected font.

WriteText() is meant for Ansi text - whatever the current font.
WriteUTF8Text() is meant for UTF8 encoded unicode text, whatever the current 
font.

The user of the API should not have to care what font is used.
the API should do whatever is necessary to emit correct PDF for the current 
font.

If internally there are different calls needed for different fonts, then
that is OK, but they should not be exposed to the user, at the best they should 
be made protected.
(if need be, we can expose them later)

If the currently used font does not contain the necessary glyphs to represent
the text, we will not check it, that is the responsability of the user.

Michael.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator: please test

2016-04-10 Thread Ondrej Pokorny

On 10.04.2016 1:02, Graeme Geldenhuys wrote:

   P.WriteUTF8Text(25, 20, 'Sample Text');
>
>xFontCache := TFPFontCacheList.Create;
>try
>  xFont := TFPFontCacheItem.Create('fonts\FreeSans.ttf');
>  xFontCache.Add(xFont);
>  xWidth := xFont.TextWidth('Sample Text', cFontSize) * 25.4 / 72; //
>25.4 / 72 = conversion PDFTomm (?)

I believe here is your mistake. Your system is probably 96 DPI, not 72.


IMO it's not about my system DPI (fppdf is headless and doesn't use the 
GUI DPI). It's the default value in TFPFontCacheList.DPI. Correct?
I expected fpttf it to use 72 DPI which is the default for PDF 
(cDefaultDPI in fppdf.pas). My mistake.



If you use gTTFontCache.DPI it would have given you the correct result.


Indeed, thanks!


At the moment the FontCache object defaults to the most common desktop
DPI, which is 96, but in your actual application you can query it with
whatever GUI you have and set the value yourself.


Great, thanks Graeme for the code and clarifying, it works!
(IMO it would be great to update the example code with "box around text" 
code. It is a usual task to get text width/height and so you spare your 
time to clarify it to another person who needs it in the future.)


Ondrej

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus