CamBam
News:
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 13, 2018, 23:01:05 pm


Login with username, password and session length


Pages: 1 ... 11 12 [13]
  Print  
Author Topic: CamBam plus V1.0 (Linux development release)  (Read 33171 times)
Bob La Londe
CNC Jedi
*****
Online Online

Posts: 3385


^ 8.5 pounds on my own hand poured bait.


View Profile WWW
« Reply #180 on: October 14, 2018, 16:08:06 pm »

They are all Ubuntu with different desktop managers. AFAIK Mint uses Cinnamon and mine uses Mate desktop environment. Maybe it's desktop environment related. But it was OK regarding font sizes on my computer. Something changed in Mono. Might it be that it is .NET 4.5 compliant and CB 1.0 is targeted to 4.0 ?



.NET supposedly incorporates previous .NET capability.  Windows 10 and 1.0 seem to work and if I recall Windows 10 comes with 4.6 preinstalled. 

Maybe the current MONO release is not 100% .NET compatible. 

Back when I took an assembler class (27-28 years ago) I found often BIOS calls that worked the same from one BIOS to the next, but did odd things like changing unrelated registers.  I considered them bugs, but the programmer I am sure thought they were just fine because the surface function of the call was the same.  I had to do extra book keeping like pushing those registers to the stack before calling the functions.  Back then it was much less complex too.  I was writing code for a mixed bag of XT and early AT machines, but the BIOS' and OS' at the time where much less complex than they are today.  Probably two or three orders of magnitude.  Anyway, to me its a miracle really that so much portability between machines is even possible today.
Logged

Getting started on CNC?  In or passing through my area?
If I have the time I'll be glad to show you a little in my shop. 

Some Stuff I Make with CamBam
http://www.CNCMOLDS.com
onekk
Wookie
****
Offline Offline

Posts: 390


View Profile
« Reply #181 on: October 14, 2018, 18:15:48 pm »

I doubt that specifying a linux distribution is the solution.


This link could explain some more about
https://www.mono-project.com/docs/faq/winforms/

This is the value printed when I perform

Code:
string f_string = System.Drawing.SystemFonts.DefaultFont.ToString();


and then print this value in the about box of my plugins

Font: Name=DejaVu Sans, Size=8.25, Units=3, GdiCharSet=1, GdiVerticalFont=False]


EDIT:

I have found in the sources of mono, (I have downloaded them now) that in the code the fonts are declared here:

Code:
public static Font CaptionFont {
get { return new Font ("Microsoft Sans Serif", 11, "CaptionFont"); }
}

public static Font DefaultFont  {
get { return new Font ("Microsoft Sans Serif", 8.25f, "DefaultFont"); }
}

public static Font DialogFont  {
get { return new Font ("Tahoma", 8, "DialogFont"); }
}

public static Font IconTitleFont  {
get { return new Font ("Microsoft Sans Serif", 11, "IconTitleFont"); }
}

public static Font MenuFont  {
get { return new Font ("Microsoft Sans Serif", 11, "MenuFont"); }
}

public static Font MessageBoxFont  {
get { return new Font ("Microsoft Sans Serif", 11, "MessageBoxFont"); }
}

public static Font SmallCaptionFont  {
get { return new Font ("Microsoft Sans Serif", 11, "SmallCaptionFont"); }
}

public static Font StatusFont  {
get { return new Font ("Microsoft Sans Serif", 11, "StatusFont"); }
}      


Maybe this thing mean that settings a font substitution table "Microsoft Sans Serif" => "Another font" could resolve the problem.

Some time ago someone has modified the above listed code to incorporate a change that read a proper MONO_FONT_SOMETHING environment variable to load that font instead of the default one set in the code, but that code has disappeared from the web.

Maybe loading or better copying from a windows installation the MS Sans Serif TTF font could solve some problems.

I have to investigate if it is feasible a substitution that change the "metrics" so if it is possible to change a font substitution that to "MS Sans Serif" 8pt to "Otherfont" 10pt it could be feasible to fine tune the interface.


I have to investigate if i could change in some manner this DefaultFont Value.

In theory it is taken from the control panel in windows but I have to check how this thing is performed on Linux, maybe some luck here could help to set the default font used by CamBam interface, as it seem to honour the scale factor of some DE.

I hope there is a way to perform something about this.


Regards

Carlo D.
« Last Edit: October 14, 2018, 20:38:54 pm by onekk » Logged

Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam
django013
CNC Ewok
*
Offline Offline

Posts: 12


View Profile
« Reply #182 on: October 15, 2018, 10:27:46 am »

Quote
Unfortunately I practically have stopped working with CB for Linux. Because after the last major Mono update I got the opposite of what django013 describes - the size of the font in the built-in menus became huge. Text does not fit into the fields and I can't solve the problem.
May be, it depends on whether Tahoma TTF exists on linux box.
I once created a backup of all windows TTF-fonts and installed that on my linux box.

Quote
I have found in the sources of mono, (I have downloaded them now) that in the code the fonts are declared here ...
Hm, from what I see, it's not possible to replace the definitions without replacing the source file.
I don't know nothing about mono - may be mono has some system call to replace system font items like "DialogFont"?
Maybe the replaced settings will then be saved to mono registry on linux system?

Quote
Andy mentioned to me that he was considering specifying a particular Linux distro for CamBam due to the differences across versions and the effort involved in trying to make it work on all of them. He also mentioned that Linux Mint seemed to work well.
If mono developers would have followed linux guidelines, that restriction would not be necessary.
On linux systems the window manager is responsible for fonts, styles and sizes and applications could ask window-manager for font-ids.

cheers Reinhard
« Last Edit: October 15, 2018, 10:32:51 am by django013 » Logged
onekk
Wookie
****
Offline Offline

Posts: 390


View Profile
« Reply #183 on: October 15, 2018, 11:22:36 am »

Some investigation is needed, but if I put in the plugin

Code:
public static void plugin_clicked(object sender, EventArgs e)


These lines

Code:
iface.Owner.SuspendLayout();
            iface.Owner.Font = new System.Drawing.Font(System.Drawing.FontFamily.GenericSansSerif, 9, System.Drawing.FontStyle.Bold);
iface.Owner.ResumeLayout();

The font in the Layer and System tree change according to the settings.

Maybe creating a plugin that will permi to choose the relevant fonts, once CamBam is started and the plugin clicked may permit to change all the relevant fonts, some investigation are needed.

In the meantime, I have put on the issue page of mono at

Code:
https://github.com/mono/mono/issues/11158

a very bad bug reposts, asking for some manner to specify in the command line the default font used at least on Linux.

Just a try.

Regards

Carlo D.

Logged

Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam
Dragonfly
CNC Jedi
*****
Offline Offline

Posts: 2035



View Profile
« Reply #184 on: October 16, 2018, 20:59:05 pm »

Tried with XFCE desktop (Xubuntu) - same large fonts.
Logged

Before asking a question do some effort and walk through all menus and options in CamBam.  Maybe the answer is there. Please.
onekk
Wookie
****
Offline Offline

Posts: 390


View Profile
« Reply #185 on: October 17, 2018, 10:38:55 am »

it depends on where mono took the default font definition, XFCE uses Gnome library so I suppose the problem is fontconfig substitution.

see https://seasonofcode.com/posts/how-to-set-default-fonts-and-font-aliases-on-linux.html

and

http://eosrei.net/articles/2016/02/changing-default-fallback-subsitution-fonts-linux

and also

https://eev.ee/blog/2015/05/20/i-stared-into-the-fontconfig-and-the-fontconfig-stared-back-at-me/

for possible hints on how to resolve some problems.

Still investigating the mechanism mono used to derive the standard fonts on Linux.

Regards

Carlo D.
Logged

Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam
Dragonfly
CNC Jedi
*****
Offline Offline

Posts: 2035



View Profile
« Reply #186 on: October 17, 2018, 12:13:33 pm »

I went further and actually installed Arial, Tahoma and Verdana fonts. And set Arial as the default for both GTK and Qt. No change.
I think it's not related to the font as such but the way its metrics (em grid size) and screen resolution are interpreted for rasterization.
I'd like to emphasize on the fact that only CamBam internal menus and toolbar text is huge. Third party plugins open their windows with normal font size. The status bar with the current mouse pointer coordinates uses the right font size, though.

If you expand the attached screenshot to view it at 100% (1:1) scale you will see the differences.


* CB-Fonts.png (130.95 KB, 1919x1058 - viewed 25 times.)
Logged

Before asking a question do some effort and walk through all menus and options in CamBam.  Maybe the answer is there. Please.
onekk
Wookie
****
Offline Offline

Posts: 390


View Profile
« Reply #187 on: October 18, 2018, 10:18:54 am »

In Fact, the plugins are made with the Visual Studio Designer (i don't rember well the name, as in Linux there is no Creator program and you have to make the interface by hand or use an interface code done in Windows and reuse it in Linux).

Generally in the interface code the size is defined so it is "honoured" by CamBam.

According to some of my reserch in .NET there is no manner to specificy a default font other than those defined at Windows Level, and Mono internally it uses the fallback I've extracted from the Mono code  on Github.

But as in .NET there is no mechanism to specify the font other than explicitly declare them in the interface creation, Mono is merely replicating the Windows behaviour.

IN the past there is an old implementation of a modified Mono System.Drawing or System.Forms where the fallback fonts could be modified passing a

Code:
MONO_DEFAULT_FONT =

In the line invoking Mono in Linux or setting a environment variable, but this code has disappeared.

I think the only way is to recompile CamBam with a font setting mechanism, but as the sources are not available we are left at Andy goodwills and developing times.

I don't know how large is the Linux Base, but as actually is the only affordable CAM for Linux I hope it will be patched soon.

I have made some experiments on changing the interface fonts through a plugin, but only the entities windows seem to respond to the defaultfont change, with the code I've published in one of my past messages.

Maybe some join efforts could be done to develop a "Interface font tweak" plugin that permit a fine specifications of the fonts used in the interface, but most of them are marked as "read only" as the have only a get method and not a set method.

Regards

Carlo D.
Logged

Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3654



View Profile
« Reply #188 on: October 18, 2018, 14:16:27 pm »

Have a look here; http://www.brusselsprout.org/CAMBAM/ it may give some clues.
This old version of CamBam can be viewed with ILSpy, but what we don't know is, how much has the GUI code changed ?
Logged
onekk
Wookie
****
Offline Offline

Posts: 390


View Profile
« Reply #189 on: October 18, 2018, 16:36:51 pm »

Have a look here; http://www.brusselsprout.org/CAMBAM/ it may give some clues.
This old version of CamBam can be viewed with ILSpy, but what we don't know is, how much has the GUI code changed ?

The problem I think is not in the Things viewable with ILSpy, I could have a decent look in the C# code with monodevelop, some IL___ something appear when there is some code that isn't "readable", in general, the problem arise early in the interface.

Linux versions I think are slightly different, but Mono has different methods to obtain the metrics.

From a quick view of the dll in the cambam program directory there is also and OpenTK.dll, From a quick search this is the "graphics engine" that interface with the openGL part in Linux, and maybe it is used also to do some math, (The library is annouced as a "Low-level C# binding for OpenGL, OpenGL ES and OpenAL.".

There are many part when the problem of font scaling could arise, especially noting the difficult to access the CamBam interface in the plugin.

If some workaround could be found to access the Font properties of some controls menu and listbox like the millimeters shown in some pics reporting strange behaviour, maybe something could be done, if not, and if the Linux users are left behind, the only "viable" solution left are:

1) use a virtual machine with some windows on it maybe even an old windows XP
2) trying to live with the flawn
3) using the poor implemented FreeCAD path workbench, and hoping in better times.

I'm not very happy with the developing efforts put in CamBam, and I hope a new ways could be found in improving CamBam as it in general is a good program, and I'm quite happy to work with it (I'm still developing some plugins for it).


Regards

Carlo D.
Logged

Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam
Dragonfly
CNC Jedi
*****
Offline Offline

Posts: 2035



View Profile
« Reply #190 on: October 18, 2018, 18:22:19 pm »

BTW, has somebody tried CB with Wine?
Logged

Before asking a question do some effort and walk through all menus and options in CamBam.  Maybe the answer is there. Please.
onekk
Wookie
****
Offline Offline

Posts: 390


View Profile
« Reply #191 on: October 19, 2018, 07:42:42 am »

Gotcha! This code in the init phase of my plugin will change all the menus with the desidered font at least in CamBam 0.9.8

The main problem is that you have to list all the control by hand, I hoped that with an iterable of CamBamUI.MainUI.Menus.Controls the job could be done automatically taking account of all the variants, but no luck.

I'm working on the context menu too, but just in case with some work a Change font plugin could be done.

If someone could test the code with 1.0.0 to confirm the same mechanism in the interface, maybe we could iron out some quirks.


Code:
CamBamUI.MainUI.Menus.SuspendLayout();
System.Drawing.Font cFont = new System.Drawing.Font(System.Drawing.FontFamily.GenericSansSerif, 8, System.Drawing.FontStyle.Italic);
CamBamUI.MainUI.Menus.mnuFile.Font = cFont;
CamBamUI.MainUI.Menus.mnuEdit.Font = cFont;
CamBamUI.MainUI.Menus.mnuDraw.Font = cFont;
CamBamUI.MainUI.Menus.mnuMain.Font = cFont;
CamBamUI.MainUI.Menus.mnuHelp.Font = cFont;
CamBamUI.MainUI.Menus.mnuView.Font = cFont;
CamBamUI.MainUI.Menus.mnuTools.Font = cFont;
CamBamUI.MainUI.Menus.mnuScript.Font = cFont;
CamBamUI.MainUI.Menus.mnuPlugins.Font = cFont;
CamBamUI.MainUI.Menus.mnuMachining.Font = cFont;
            CamBamUI.MainUI.Menus.ResumeLayout(true);

For wine I don't know, but wine is another emulation layer ao if the "standard" linux version could be improved it will be better.


EDIT: I'm trying to make a plugin plugin,

Included are the sources:

In the plugin drop down you have an item named Change Font

If you click on Choose a font dialog will appear with the original mnuFile font taken form the UI
you can change it to whatewer you want
click on Change and the font will change

For now only the menubar is wokring, for the rest of the interface, We have to find out the relevant Controls

I've tried some things:

For the context menu the items marked as FAIL

Code:
// CamBamUI.MainUI.ViewContextMenus             - FAIL
// CamBamUI.MainUI.CADFileTree.ContextMenuStrip - FAIL

Some help is needed to make it something useful, maybe some help by "THE CREATOR" will be very welocomed.


Regards

Carlo D.

* ChangeFont.zip (2.85 KB - downloaded 7 times.)
« Last Edit: October 19, 2018, 09:25:03 am by onekk » Logged

Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam
dave benson
CNC Jedi
*****
Offline Offline

Posts: 1009


View Profile
« Reply #192 on: October 19, 2018, 10:39:07 am »

HI Carlo
Is this of any help.
Dave


* context menu strip getting and setting the font.PNG (20.46 KB, 1096x241 - viewed 27 times.)

* font properties and methods for CB.PNG (12.63 KB, 709x248 - viewed 25 times.)
Logged
Dragonfly
CNC Jedi
*****
Offline Offline

Posts: 2035



View Profile
« Reply #193 on: November 08, 2018, 09:03:45 am »

I rolled back (with a bit of trouble) to Mono 5.12. Now the GUI is as expected.
I had to install 'mono-complete' to be sure all dependencies are installed because 'mono-runtime' does not install all libraries needed by CamBam. Even then the Visual Basic support library was not installed and some of the plugins threw errors. Had to install it manually.
The still unanswered question is why Mono 5.14 and the latest 5.16 cause the wrong font size in the menus.
Logged

Before asking a question do some effort and walk through all menus and options in CamBam.  Maybe the answer is there. Please.
onekk
Wookie
****
Offline Offline

Posts: 390


View Profile
« Reply #194 on: November 08, 2018, 15:38:59 pm »

I suspect that something is changed in which font is used as a base by Mono, System.Windows.Form in Linux is based on Systems.Drawings ( my memory didn't rmember exatcly so I've not cheched the correct form).

System.Drawings assume a base font derived from somewhere in the Linux interface. (seems that is affected by the scale factor found in some DE).

Maybe not the MONO is the culprit (in a strict way) but some other libraries that are used or which MONO is compiled against.

I've filed a bug report but nobody has answered yet https://github.com/mono/mono/issues/11158,
maybe if someone else would post some other info in this "bug Report" someone at MONO will give us some answers.

I was intentionally generic, maybe opening some other BigReport with some informations, and maybe request for explanations, or workarounds, will help to point out where the problem is.

Other report like our problem maybe:

Mono fails to render correctly Roboto font #11576

or:
https://github.com/mono/mono/issues/11543

https://github.com/mono/mono/issues/11189

https://github.com/mono/mono/issues/11093

and generally many of the problem listed in

https://github.com/mono/mono/labels/area-BCL%3A%20System.Windows.Forms


Regards

Carlo D.
« Last Edit: November 08, 2018, 15:49:41 pm by onekk » Logged

Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam
Pages: 1 ... 11 12 [13]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.161 seconds with 19 queries.

Copyright © 2018 HexRay Ltd. | Sitemap