Commit Graph

18 Commits

Author SHA1 Message Date
Abdelrazak Younes
86c1053f51 Revert to revision 17835: I applied the wrong tree!
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17840 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-17 16:49:17 +00:00
Abdelrazak Younes
71e8668375 Fix bug 1395 by Stefan Schimanski:
Locking counter added to MacroData: it is increased before drawing/
metric calculations and decreased afterwards in InsetMathMacro. If a  
macro is already locked at that point, "Self reference: \foo" is  
drawn instead of the macro definition to avoid endless loops.  
Moreover inside of the arguments of the macro the counter is  
temporarily decreased as those cases do not cause loops. (fixes bug  
#1395)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17836 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-17 13:15:00 +00:00
Enrico Forestieri
a33f6ed840 Avoid random kerning values.
* src/mathed/MathData.C
	(MathArray::metrics): Explicitly initialize kerning_ as it may
	contain random data when the nucleus is an empty MathFont inset.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17560 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-26 00:05:28 +00:00
Enrico Forestieri
7fb8a4a595 Correctly implement rule 18a in appendix G of the TeXbook
* src/mathed/InsetMathScript.C
	(isAlphaSymbol): New. Return true if nucleus is a letter or a
	symbol whose type is mathord or mathalpha.
	(InsetMathScript::dy01): Apply rule 18a accounting for nucleus type.

	* src/mathed/MathData.C
	(MathArray::metrics): Account for the fact that some fonts (eg.
	mathcal) do not have a lower case x glyph.

	* src/mathed/InsetMathSymbol.[Ch]
	(InsetMathSymbol::isOrdAlpha): New. Return true if type of symbol
	is mathord or mathalpha.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17518 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-23 02:12:48 +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
Enrico Forestieri
54cd34f60b Fig bug 3335 (http://bugzilla.lyx.org/show_bug.cgi?id=3335)
* src/mathed/InsetMathScript.[Ch]
	(InsetMathScript::dy01): new, jointly account for both superscript
	and subscript according to the rules in Appendix G of the TeXbook.
	(InsetMathScript::dy0, InsetMathScript::dy1): set ascent and descent
	values using dy01 for non-limits super/subscripts.
	(InsetMathScript::metrics): account for the new super/subscript
	placement rules when setting ascent and descent values.

	* src/mathed/MathData.[Ch]
	(MathArray::metrics): cache parameters needed for super/subscript
	placement. When nucleus is not empty, set its ascent value to zero
	such that it is correctly computed later, otherwise ascent values
	less than that of an 'I' are not reported.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17471 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-18 15:00:57 +00:00
Abdelrazak Younes
493ec52c3f * Dimension is a simple wrapper class again.
* other files: use FontMetrics::dimension() method instead of old Dimension interface.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16167 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-04 10:45:43 +00:00
Abdelrazak Younes
8f98ec35e4 This commit fixes the following bug:
http://bugzilla.lyx.org/show_bug.cgi?id=2900

The only drawback is that it requires about 20Mo extra-memory when loading the UserGuide. If it turns out to be too much, we can switch to a QHash based solution instead of a table.

* dimension.[Ch]:
  - Dimension(LyXFont const, char_typec): new ctor
  - set(LyXFont const & font, char_type c): new method.

* frontends/FontMetrics.h:
  - width(char_type): is now a pure virtual method.

* GuiFontMetrics:
  - CharMetrics: new structure;
  - the metrics cache now also cache ascent and descent. This is especially useful for mathed.

* MathSupport.[Ch]:
  - mathed_char_dim(): deleted. We now use Dimension::set() directly instead.

* rowpainter.C: fixe empty space.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16124 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-01 16:12:24 +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
Abdelrazak Younes
eb651c3d61 Move BufferView cached pointer out of LyXText:
* LyXText
  - bv(), bv_owner, : deleted.
  - These methods now need a (Buffer const &) argument: getFont(), applyOuterFont(), getLayoutFont(), getLabelFont(), setCharFont(), setLayout(), singleWidth(), leftMargin(), rightMargin(), computeRowMetrics(), isMainText(), spacing(), isRTL(), cursorX(), rowBreakPoint(), setRowWidth(), labelFill(), labelEnd().
  - These methods now need a (BufferView const &) argument and are propably candidates for future removal when 1.6 is opened for development: redoParagraph(), x2pos(), getRowNearY(), getColumnNearX(), checkInsetHit(), setHeightOfRow().
  - recUndo(): now need a LCursor argument.
 
* CoordCache::get(LyXText const *, pit_type):
  - now const.
  - use const_iterator instead of iterator.

* FontIterator:
  - add (Buffer const &) argument to ctor
  - buffer_: new const reference to applicable BufferView.

* InsetBase
  - xo(), yo(), covers() and neverIndent() are now const.

* InsetText::setViewCache(): deleted

All other changes are due to the LyXText and InsetBase API changes.



 
  

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15618 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-30 12:45:33 +00:00
Abdelrazak Younes
54bdecdb48 remove paperHeight() and paperWidth() in Painter and inherited classes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15589 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-28 09:36:22 +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
Georg Baum
8b67659646 Use UTF8 for LaTeX export.
Known problems:
- No space is output after a \hfill. I probably broke this with the
  InsetCommand patch. I'll have a look later.
- Although the encoding is now UTF8 the arguments of the inputenc package
  are still the old ones, so LaTeX will not run.
- Labels and references with non-ASCII characters are broken. This needs to
  be fixed in lyx::support::escape(), but this is a file format change.
- Something seems to be wrong with index entries, but this is probably also
  due to the InsetCommand changes.

Have fun!


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15378 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-19 16:51:30 +00:00
Abdelrazak Younes
3a32fff90e Adjust the FIXME texts and Delete commented out setXY() call following Andre comments about it:
The coordcahce is for up/down navigation and vconverting mouseclicks to text positions. It is not for pure display/export which
is what drawT is about. It was a simple oversight not to remove it after some copying from the 'real' draw() method.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15347 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-16 09:08:05 +00:00
Abdelrazak Younes
d37fae169c In order to support multiple LyXView each BufferView needs its own CoordCache. This is what's implemented in this commit.
theCoords is now a thing of the past and all CoordCache accesses are done via BufferView::coordCache() now. I had to modify a number of methods to pass BufferView.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15324 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-13 16:44:44 +00:00
Abdelrazak Younes
0da12b129a delete unneeded BufferView.h declaration.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15159 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-26 21:11:22 +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