View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0030911 | Open CASCADE | OCCT:Visualization | public | 2019-08-22 08:34 | 2021-12-17 18:41 |
Reporter | nds | Assigned To | |||
Priority | normal | Severity | integration request | ||
Status | closed | Resolution | fixed | ||
Product Version | 6.7.0 | ||||
Target Version | 7.5.0 | Fixed in Version | 7.5.0 | ||
Summary | 0030911: Visualization - Font_BRepFont using as a usual Standard_Transient | ||||
Description | In 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. | ||||
Tags | No tags attached. | ||||
Test case number | Not required | ||||
|
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 |
|
-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")/ |
|
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 |
|
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) |
|
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. |
|
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. |
|
-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? |
|
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; |
|
Dear Kirill, could you please check patch on CR30911_3 branch. Now, brep font inherits Standard_Transient. |
|
Please raise the patch - OCCT branch: CR30911_3. |
|
Branch CR30911_3 has been updated forcibly by nds. SHA-1: c8a1119a9783b12e7ffeb577874e5afade383c06 |
|
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 |
|
Branch CR30911_3 has been updated forcibly by nds. SHA-1: 5bb41cb2bce7615ab95f6520640a5dc6e0b46fbc |
|
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; |
|
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; |
|
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 |
|
I have no remarks to the patch. |
|
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 |
|
Branch CR30911_4 has been deleted by inv. SHA-1: 12f833fd06402b8b35fa481cbdb6a22c8ae71df1 |
|
Branch CR30911_3 has been deleted by inv. SHA-1: e2e4e2eff9bfd0bcae2771352a632ea015ed870c |
|
Branch CR30911_2 has been deleted by inv. SHA-1: 645bb8fd77d0e6acb92cfa12a89f271276819e70 |
|
Branch CR30911_1 has been deleted by inv. SHA-1: 7c7433abcc8308db4179b0d9bc45ccf111dc7618 |
|
Branch CR30911 has been deleted by inv. SHA-1: a84e833bb035b7ba7440b539d39fde73b359faa3 |
occt: master ac5b3cbc 2020-09-25 12:00:43
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; |
Affected Issues 0030911 |
|
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 | ||
occt-products: master b31a7940 2020-09-28 07:12:21 Details Diff |
0030911: Visualization - Font_BRepFont using as a usual Standard_Transient |
Affected Issues 0030911 |
|
mod - diff | Diff File | ||
mod - diff | Diff File |
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 | |
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 |
|
Changeset attached | => occt master ac5b3cbc |
2020-10-03 14:05 |
|
Assigned To | bugmaster => abv |
2020-10-03 14:05 |
|
Status | tested => verified |
2020-10-03 14:05 |
|
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 | |
2020-12-02 16:40 |
|
Fixed in Version | => 7.5.0 |
2020-12-02 17:12 |
|
Status | verified => closed |
2021-12-17 18:41 | nds | Changeset attached | => occt-products master b31a7940 |