Commit Graph

18 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
d8eaec5c03 fix compilation warnings: unused parameters
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22347 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-03 15:44:05 +00:00
Stefan Schimanski
9ac321f28f * kerning may depend on the BufferView because the metrics of some insets (e.g. math macros) depend on the cursor position in the view
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22259 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-22 14:39:22 +00:00
Abdelrazak Younes
5ddc612b73 Splitup Font in saner bits:
* Font::FontBits -> FontInfo
* Font::FONT_XXX -> all enums transfered to FontEnums.h and renamed to FontXxx

I've replaced Font uses with FontInfo were the language() member was not needed, basically all draw() and metrics methods. There's one problematic cases with InsetQuotes which I solved by taking the Buffer main language.




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21240 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-28 18:51:54 +00:00
Abdelrazak Younes
fb6af9a08a Remove remnant of the past.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20481 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-25 07:41:03 +00:00
Abdelrazak Younes
137158532b Put mathed on a diet: transfer dimension cache from inset to BufferView.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20457 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-23 22:39:49 +00:00
Abdelrazak Younes
696b5d29b5 Temporarily fix cursor positioning within mathed.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20452 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-23 16:55:15 +00:00
Abdelrazak Younes
237c132c1e * Inset:
- get rid of the cached Dimension. Text inset dimensions are saved in ParagraphMetrics and mathed maintain their own dimension where needed.
- width(), ascent(), descent(): deleted.
- dimension(): now needs a valid BufferView.
- metrics(): now void.

* BufferView::getCoveringInset(): simplify.

* ParagraphMetrics(): now cache inset dimensions.




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20420 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-21 20:39:47 +00:00
André Pönitz
ed858d73e5 use bald pointers in clone()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19920 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-30 18:03:17 +00:00
Abdelrazak Younes
bd3e07179f Remove optimization to avoid char and symbol metrics calculation. This was incompatible with the way the font zooming works in LyX.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18266 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-11 14:17:53 +00:00
André Pönitz
fc6ce7cd08 rename LyXFont to Font except in tex2lyx
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18095 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-29 18:17:15 +00:00
André Pönitz
32871c1284 rename InsetBase to Inset
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18089 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-29 13:39:47 +00:00
Bo Peng
00e305c9d9 Rename .C ==> .cpp for files in src, part one
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18018 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-26 04:41:58 +00:00
Abdelrazak Younes
24c8ca10d2 Trying to solve bug-2452, I optimized some of the most significant problems outlined in the profile report attached in there.
This commit avoids unnecessary metrics recalculations by caching the last LyXFont used. I had to cleanup the width(), ascent() and descend() redundancies by transferring that to InsetBase.

InsetMathDim should go now as it is not really needed.

* InsetBase: properly handle inset Dimension.

* InsetOld: get rid of redundant width(), ascent() and descent()

* InsetMathDim: ditto

* InsetMathChar::metrics(): avoid metrics recalculation if font is unchanged.

* InsetMathSymbol::metrics(): ditto

* InsetMathKern: use InsetBase::dim_ instead of local ones.

* InsetMathSpace:
  - use InsetBase::dim_ instead of local ones.
  - space to width transformation transferred to anonymous namespace.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17899 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-22 08:26:06 +00:00
Enrico Forestieri
5b2d7ec76d Account for real width of nucleus when positioning superscripts in mathed
* src/mathed/MathSupport.[Ch]
	(mathed_char_kerning): New. Compute right kerning for the given
	font and character as the difference between right bearing and
	logical width.

	* src/mathed/InsetMathScript.[Ch]
	(InsetMathScript::dx1, InsetMathScript::metrics): Account for
	nucleus right kerning.
	(InsetMathScript::nker): New. Return the nucleus right kerning
	if positive, zero otherwise.

	* src/mathed/MathData.[Ch]
	(MathArray::metrics): Cache the nucleus right kerning value.
	(MathArray::kerning): New. Return cached right kerning.

	* src/mathed/InsetMathChar.[Ch]
	(InsetMathChar::metrics): Cache the character right kerning.
	(InsetMathChar::kerning): New. Return cached right kerning.

	* src/mathed/InsetMath.h
	(InsetMath::kerning): New virtual method.

	* src/mathed/InsetMathSymbol.[Ch]
	(InsetMathSymbol::metrics): Cache the symbol right kerning.
	(InsetMathSymbol::kerning): New. Return cached right kerning.

	* src/mathed/InsetMathFont.[Ch]
	(InsetMathFont::kerning): New. Return cached right kerning.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17497 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-21 17:21:59 +00:00
Abdelrazak Younes
e24bf64c68 * dimension.h: new operator!=() and operator=()
* InsetBase and all derivates:
  - metrics(MetricsInfo & mi, Dimension & dim) now returns a bool (true if metrics changed).

* MathData and all derivates:
  - metrics(MetricsInfo & mi, Dimension & dim): ditto.

* RenderBase and all derivates:
  - metrics(MetricsInfo & mi, Dimension & dim): ditto.

* lyxtext.h/text.C:
  - LyXText::metrics(MetricsInfo & mi, Dimension & dim): ditto.
  - LyXText::redoParagraph(): take into account potential change in inset metrics.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16091 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-28 15:15:49 +00:00
André Pönitz
de6418f377 use more unicode in math
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15462 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-22 10:15:23 +00:00
André Pönitz
6c300f72a2 move everything into namespace lyx
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15422 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-21 00:16:43 +00:00
André Pönitz
e89625ef28 rename mathed/math_xinset into mathed/InsetMathX
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15026 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-17 09:14:18 +00:00