MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030911Open CASCADE[OCCT] OCCT:Visualizationpublic2019-08-22 08:342020-10-03 14:42
Reporternds 
Assigned Toabv 
PrioritynormalSeverityintegration request 
StatusverifiedResolutionfixed 
PlatformOSOS Version
Product Version[OCCT] 6.7.0 
Target Version[OCCT] 7.5.0Fixed in Version 
Summary0030911: Visualization - Font_BRepFont using as a usual Standard_Transient
DescriptionIn a custom development we have some text manager, which decides what font should be used depending on the application option. It is either Font_FTFont or Font_BRepFont.

We have limitations in using Font_BRepFont:
- it has a protected inheritance of Font_FTFont(Standard_Transient), so is not possible to have it as a handle. So, we may not have one pointer to type and do cast to one or another type.
- there is no implementation FindAndCreate for it.

It's proposed to make it public inherited class of Font_FTFont and implement create method.
TagsNo tags attached.
Test case numberNot required
Attached Files

- Relationships
child of 0024181closedbugmaster Open CASCADE Text to BRep functionality 

-  Notes
(0086394)
git (administrator)
2019-08-22 08:36

Branch CR30911 has been created by nds.

SHA-1: a84e833bb035b7ba7440b539d39fde73b359faa3


Detailed log of new commits:

Author: nds
Date: Thu Aug 22 08:33:14 2019 +0300

    0030911: Visualization - Font_BRepFont using as a usual Standard_Transient
(0086399)
kgv (developer)
2019-08-22 10:03

-class Font_BRepFont : protected Font_FTFont
+class Font_BRepFont : public Font_FTFont

The purpose of protected inheritance here is hiding visibility of Font_FTFont methods, which should not be used by Font_BRepFont users to avoid getting unexpected results.

If this leads to making a Handle of Font_BRepFont, then this should be either fixed by adding visibility to necessary methods (preserving "protected Font_FTFont") or by hiding visibility of most Font_FTFont methods (changing to "public Font_FTFont")/
(0086410)
git (administrator)
2019-08-22 12:27

Branch CR30911_1 has been created by nds.

SHA-1: 7c7433abcc8308db4179b0d9bc45ccf111dc7618


Detailed log of new commits:

Author: nds
Date: Thu Aug 22 12:24:26 2019 +0300

    0030911: Visualization - Font_BRepFont using as a usual Standard_Transient
(0086412)
nds (developer)
2019-08-22 12:34

Dear Kirill,

please have a look at proposed modifications. What is your opinion, might it be useful in OCCT?

The modifications has additionally API change of Font_BRepFont:
recommendation of using FindAndCreate instead of own FindAndInit.

This is not obligate modification, but seems to be more universal way of both kind of font creation and reusing. (FindAndInit was introduced recently within #30663)
(0086738)
kgv (developer)
2019-09-04 16:21
edited on: 2019-09-04 16:22

I don't have any objections allowing to use Handle(Font_BRepFont), but as discussed - protected inheritance should not be simply removed since it was done for hiding base class API intentionally.

There might be no reason forcing usage of Handle(Font_BRepFont) in existing code, although the change shouldn't affect performance, since Font_BRepFont is quite a heavy object.

(0095296)
git (administrator)
2020-09-25 01:47

Branch CR30911_2 has been created by nds.

SHA-1: 645bb8fd77d0e6acb92cfa12a89f271276819e70


Detailed log of new commits:

Author: nds
Date: Fri Sep 25 01:50:05 2020 +0300

    0030911: Visualization - Font_BRepFont using as a usual Standard_Transient
    
    - Font_IFont interface is introduced to provide common necessary interface for fonts;
    - Font_FTFont/StdPrs_BRepFont inherit Font_IFont;
    - Font_FTFont Outline is implemented to obtain the contour needed in StdPrs_BRepFont;
    - StdPrs_BRepFont implements FindAndCreate;
    - StdPrs_BRepFont stores Font_FTFont as an internal field;
    - StdPrs_BRepFont the RenderGlyph is renamed into RenderGlyphShape.
(0095311)
kgv (developer)
2020-09-25 11:35

-float Font_FTFont::Descender() const
+Standard_ShortReal Font_FTFont::Descender() const
 {
-  return float(myFTFace->descender) * (float(myFTFace->size->metrics.y_ppem) / float(myFTFace->units_per_EM));

+  return Standard_ShortReal(myFTFace->descender)
+      * (Standard_ShortReal(myFTFace->size->metrics.y_ppem)
+       / Standard_ShortReal(myFTFace->units_per_EM));

Please revert these changes.
There is no reason to prefer Standard_ShortReal over float here.

+#include <ftimage.h>

FreeType headers were not included within Font_FTFont.hxx intentionally - see comment at the top of file.

+  DEFINE_STANDARD_RTTI_INLINE(Font_IFont, Standard_Transient)

Please use DEFINE_STANDARD_RTTIEXT when possible.

+  //! Render specified glyph into internal buffer (bitmap).
+  Standard_EXPORT virtual bool RenderGlyph (const Standard_Utf32Char theChar) Standard_OVERRIDE;

Please move to `protected` section.

-  Standard_Real AdvanceX (const Standard_Utf32Char theUCharNext)
+  virtual Standard_ShortReal AdvanceX (const Standard_Utf32Char theUCharNext) const Standard_OVERRIDE
   
{
-    return myScaleUnits * Standard_Real(Font_FTFont::AdvanceX (theUCharNext));
+    return Standard_ShortReal(myScaleUnits) * myFTFont->AdvanceX (theUCharNext);
   }

Why single precision floating point is considered enough for creating a TopoDS_Shape, which uses double precision?
(0095320)
git (administrator)
2020-09-25 14:57

Branch CR30911_3 has been created by nds.

SHA-1: a4347851dc987a2b6ee3ef7cbdfba34c75ba1053


Detailed log of new commits:

Author: nds
Date: Fri Sep 25 15:00:43 2020 +0300

    0030911: Visualization - Font_BRepFont using as a usual Standard_Transient
    
    - StdPrs_BRepFont inherits Standard_Transient;
    - StdPrs_BRepFont contains Font_FTFont in internal field;
    - StdPrs_BRepFont implements FindAndCreate;
(0095321)
nds (developer)
2020-09-25 14:59

Dear Kirill,
could you please check patch on CR30911_3 branch.

Now, brep font inherits Standard_Transient.
(0095327)
kgv (developer)
2020-09-25 15:31

Please raise the patch
- OCCT branch: CR30911_3.
(0095338)
git (administrator)
2020-09-25 18:14

Branch CR30911_3 has been updated forcibly by nds.

SHA-1: c8a1119a9783b12e7ffeb577874e5afade383c06
(0095356)
bugmaster (administrator)
2020-09-27 12:04

Crashes of pmivis tests:
http://jenkins-test-12.nnov.opencascade.com/view/CR30911-CR30911-nds/view/COMPARE/ [^]

I tried to take it to IR-2020-09-25 and I got the same problems
(0095430)
git (administrator)
2020-09-28 07:15

Branch CR30911_3 has been updated forcibly by nds.

SHA-1: 5bb41cb2bce7615ab95f6520640a5dc6e0b46fbc
(0095448)
git (administrator)
2020-09-28 18:13

Branch CR30911_3 has been updated by nds.

SHA-1: e2e4e2eff9bfd0bcae2771352a632ea015ed870c


Detailed log of new commits:

Author: nds
Date: Mon Sep 28 18:16:17 2020 +0300

    0030911: Visualization - Font_BRepFont using as a usual Standard_Transient
    
    - StdPrs_BRepFont inherits Standard_Transient;
    - StdPrs_BRepFont contains Font_FTFont in internal field;
    - StdPrs_BRepFont implements FindAndCreate;

(0095449)
git (administrator)
2020-09-28 18:24

Branch CR30911_4 has been created by nds.

SHA-1: 12f833fd06402b8b35fa481cbdb6a22c8ae71df1


Detailed log of new commits:

Author: nds
Date: Fri Sep 25 15:00:43 2020 +0300

    0030911: Visualization - Font_BRepFont using as a usual Standard_Transient
    
    - StdPrs_BRepFont inherits Standard_Transient;
    - StdPrs_BRepFont contains Font_FTFont in internal field;
    - StdPrs_BRepFont implements FindAndCreate;
(0095452)
nds (developer)
2020-09-28 20:24

Dear Kirill,
it's corrected, please review.
Jenkins job: http://jenkins-test-12.nnov.opencascade.com/view/CR30911-CR30911-nds/ [^]

OCCT: CR30911_4
products: CR30911_4

Thank you for help, Natalia
(0095488)
kgv (developer)
2020-09-30 12:46

I have no remarks to the patch.
(0095628)
bugmaster (administrator)
2020-10-03 14:03

Combination -
OCCT branch : IR-2020-10-02
master SHA - 6522304c17181a09fa831c040219d611dc44b94a
a206de37fbfa0bf71bd534ae47192bbec23b8522
Products branch : IR-2020-10-02 SHA - d9c364e1137eed3249e5a05befa860c708f243c0
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 18085.050000000083 / 18057.60000000009 [+0.15%]
Products
Total CPU difference: 12174.620000000117 / 12124.200000000114 [+0.42%]
Windows-64-VC14:
OCCT
Total CPU difference: 19713.125 / 19772.65625 [-0.30%]
Products
Total CPU difference: 13533.8125 / 13527.921875 [+0.04%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0095656)
git (administrator)
2020-10-03 14:38

Branch CR30911_4 has been deleted by inv.

SHA-1: 12f833fd06402b8b35fa481cbdb6a22c8ae71df1
(0095657)
git (administrator)
2020-10-03 14:38

Branch CR30911_3 has been deleted by inv.

SHA-1: e2e4e2eff9bfd0bcae2771352a632ea015ed870c
(0095666)
git (administrator)
2020-10-03 14:39

Branch CR30911_2 has been deleted by inv.

SHA-1: 645bb8fd77d0e6acb92cfa12a89f271276819e70
(0095678)
git (administrator)
2020-10-03 14:39

Branch CR30911_1 has been deleted by inv.

SHA-1: 7c7433abcc8308db4179b0d9bc45ccf111dc7618
(0095679)
git (administrator)
2020-10-03 14:39

Branch CR30911 has been deleted by inv.

SHA-1: a84e833bb035b7ba7440b539d39fde73b359faa3

- Related Changesets
occt: master ac5b3cbc
Timestamp: 2020-09-25 12:00:43
Author: abv
Committer: abv
Details ] Diff ]
0030911: Visualization - Font_BRepFont using as a usual Standard_Transient

- StdPrs_BRepFont inherits Standard_Transient;
- StdPrs_BRepFont contains Font_FTFont in internal field;
- StdPrs_BRepFont implements FindAndCreate;
mod - src/Font/Font_FTFont.cxx Diff ] File ]
mod - src/Font/Font_FTFont.hxx Diff ] File ]
mod - src/StdPrs/StdPrs_BRepFont.cxx Diff ] File ]
mod - src/StdPrs/StdPrs_BRepFont.hxx Diff ] File ]
mod - src/StdPrs/StdPrs_BRepTextBuilder.cxx Diff ] File ]

- Issue History
Date Modified Username Field Change
2019-08-22 08:34 nds New Issue
2019-08-22 08:34 nds Assigned To => kgv
2019-08-22 08:36 git Note Added: 0086394
2019-08-22 10:03 kgv Note Added: 0086399
2019-08-22 12:27 git Note Added: 0086410
2019-08-22 12:34 nds Note Added: 0086412
2019-09-04 16:18 kgv Assigned To kgv => nds
2019-09-04 16:18 kgv Product Version => 7.3.0
2019-09-04 16:18 kgv Target Version 7.4.0 => 7.5.0
2019-09-04 16:19 kgv Relationship added child of 0024181
2019-09-04 16:19 kgv Product Version 7.3.0 => 6.7.0
2019-09-04 16:21 kgv Note Added: 0086738
2019-09-04 16:22 kgv Note Edited: 0086738 View Revisions
2019-10-10 13:52 nds Relationship added related to 0030860
2020-09-21 17:34 kgv Target Version 7.5.0 => 7.6.0*
2020-09-25 01:47 git Note Added: 0095296
2020-09-25 11:35 kgv Note Added: 0095311
2020-09-25 12:41 kgv Severity minor => integration request
2020-09-25 14:57 git Note Added: 0095320
2020-09-25 14:59 nds Note Added: 0095321
2020-09-25 14:59 nds Assigned To nds => kgv
2020-09-25 14:59 nds Status new => resolved
2020-09-25 14:59 nds Target Version 7.6.0* => 7.5.0
2020-09-25 15:31 kgv Note Added: 0095327
2020-09-25 15:31 kgv Assigned To kgv => bugmaster
2020-09-25 15:31 kgv Status resolved => reviewed
2020-09-25 18:14 git Note Added: 0095338
2020-09-27 12:04 bugmaster Note Added: 0095356
2020-09-27 12:04 bugmaster Assigned To bugmaster => nds
2020-09-27 12:04 bugmaster Status reviewed => assigned
2020-09-28 07:15 git Note Added: 0095430
2020-09-28 18:13 git Note Added: 0095448
2020-09-28 18:24 git Note Added: 0095449
2020-09-28 20:24 nds Note Added: 0095452
2020-09-28 20:24 nds Assigned To nds => kgv
2020-09-28 20:24 nds Status assigned => resolved
2020-09-30 12:46 kgv Note Added: 0095488
2020-09-30 12:46 kgv Assigned To kgv => bugmaster
2020-09-30 12:46 kgv Status resolved => reviewed
2020-10-03 12:53 bugmaster Test case number => Not required
2020-10-03 14:03 bugmaster Note Added: 0095628
2020-10-03 14:03 bugmaster Status reviewed => tested
2020-10-03 14:05 abv Changeset attached => occt master ac5b3cbc
2020-10-03 14:05 abv Assigned To bugmaster => abv
2020-10-03 14:05 abv Status tested => verified
2020-10-03 14:05 abv Resolution open => fixed
2020-10-03 14:38 git Note Added: 0095656
2020-10-03 14:38 git Note Added: 0095657
2020-10-03 14:39 git Note Added: 0095666
2020-10-03 14:39 git Note Added: 0095678
2020-10-03 14:39 git Note Added: 0095679


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker